Part Number Hot Search : 
EPSA1 76PRB12 C3195 76PRB12 2N3740 S512A LC78624E 2SA1521
Product Description
Full Text Search
 

To Download GMS30C2216 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  16/32 bit risc/dsp gms30c2 2 16 gms30c2 2 32 user?s manual jun. 29, 2001 ver. 3.1
revision 3.1 published by ida team in hynix semiconductor inc. ? hynix semiconductor 2001 . all right reserved. hynix offices in korea or distributor s and representatives listed at address directory may serve additional information of this manual. hynix reserves the right to make changes to any information here in at any time without notice. the information, diagrams, and other data in this manual ar e correct and reliable; however, hynix is in no way responsible for any violations of patents or other rights of the third party generated by the use of this manual.
specifications and information in this document are subject to change without notice and d o not represent a commitment on the part of hynix . hynix reserves the right to make changes to improve functioning. although the information in this document has been carefully reviewed, hynix does not assume any liability arising out of the use of the pro duct or circuit described herein. hynix does not authorize the use of the hynix microprocessor in life support applications wherein a failure or malfunction of the microprocessor may directly threaten life or cause injury. the user of the hynix microproces sor in life support applications assumes all risks of such use and indemnifies hynix against all damages. for further information please contact: seoul office : hynix young dong bldg. 891, daechi - dong, kangnam - gu, s eoul, korea. phone : (02) 3459 - 3662~3 fax : (02) 3459 - 3942 system ic : 1, hyangjeong - dong, hungduk - gu, cheongju, 361 - 725 , korea. phone : (0431) 270 - 4030~47 fax : (043 1) 270 - 4075 copyright 2001hynix semiconductor inc. revision jun. 29, 2001.

table of contents i table of contents 0. overview 0.1 GMS30C2216/32 risc/dsp ................................ ................................ .............. 0 - 1 0.2 block di agram ................................ ................................ ................................ .... 0 - 8 0.3 pin configuration ................................ ................................ ................................ 0 - 9 0.3.1 gms30c2232, 160 - pin mqfp - package - view from top side ........ 0 - 9 0.3.2 pin cross reference by pin name ................................ .................... 0 - 10 0.3.2 pin cross reference by location ................................ ...................... 0 - 11 0.3. 4 pin fuction ................................ ................................ ........................ 0 - 12 1. architecture 1.1 introduction ................................ ................................ ................................ ...... 1 - 1 1.1.1 risc architecture ................................ ................................ ............... 1 - 1 1.1.2 techniques to reduce cpi (cycles per instruction) ............................. 1 - 2 1.1.3 the pipeline structure of gms30c2232 ................................ ............. 1 - 7 1.2 global register set ................................ ................................ .......................... 1 - 8 1.2.1 program counter pc, g0 ................................ ................................ .... 1 - 9 1.2.2 status register sr, g1 ................................ ................................ ...... 1 - 10 1.2.3 floating - point exception register fer, g2 ................................ ..... 1 - 1 3 1.2.4 stack pointer sp, g18 ................................ ................................ ....... 1 - 1 4 1.2.5 upper stack bound ub, g19 ................................ ............................ 1 - 1 4 1.2.6 bus control register bcr, g20 ................................ ....................... 1 - 1 4 1.2.7 time r prescaler register tpr, g21 ................................ .................. 1 - 1 5 1.2.8 timer compare register tcr, g22 ................................ .................. 1 - 1 5 1.2.9 timer register tr, g23 ................................ ................................ .... 1 - 1 5 1.2.10 watchdog compare register wcr, g24 ................................ ........ 1 - 1 5 1.2.11 input status register isr, g25 ................................ ....................... 1 - 1 5 1.2.12 function control register fcr, g26 ................................ .............. 1 - 1 5 1. 2.13 memory control register mcr, g27 ................................ ............. 1 - 1 6 1.3 local register set ................................ ................................ .......................... 1 - 16 1.4 privilege states ................................ ................................ .............................. 1 - 17 1.5 register data types ................................ ................................ ....................... 1 - 18 1.6 memory organization ................................ ................................ .................... 1 - 19 1.7 stack ................................ ................................ ................................ ............... 1 - 21 1.8 instruction cache ................................ ................................ ........................... 1 - 26 1.9 on - chip memory (iram) ................................ ................................ ............. 1 - 29
ii table of contents 2. instructions general 2.1 instruction notation ................................ ................................ .......................... 2 - 1 2.2 instruction execution ................................ ................................ ........................ 2 - 2 2.3 instruction formats ................................ ................................ ........................... 2 - 3 2.3.1 table of immediate values ................................ ................................ .. 2 - 5 2.3.2 table of instru ction codes ................................ ................................ ... 2 - 6 2.3.3 table of extended dsp instruction codes ................................ .......... 2 - 7 2.4 entry tables ................................ ................................ ................................ ...... 2 - 8 2.5 instruction timing ................................ ................................ .......................... 2 - 12 3. instruction set 3.1 memory instr uctions ................................ ................................ ........................ 3 - 1 3.1.1 address modes ................................ ................................ ..................... 3 - 2 3.1.2 load instructions ................................ ................................ .................. 3 - 7 3.1.3 store instructions ................................ ................................ ............... 3 - 10 3.2 move word instructions ................................ ................................ ................. 3 - 13 3. 3 move double - word instruction ................................ ................................ ..... 3 - 13 3. 4 logical instructions ................................ ................................ ........................ 3 - 15 3. 5 invert instruction ................................ ................................ ............................ 3 - 16 3. 6 mask instruction ................................ ................................ ............................. 3 - 16 3. 7 add instructions ................................ ................................ ............................. 3 - 17 3. 8 sum instructions ................................ ................................ ............................. 3 - 19 3. 9 subtract instructions ................................ ................................ ....................... 3 - 20 3. 10 negate instructions ................................ ................................ ....................... 3 - 21 3.1 1 multiply word instruction ................................ ................................ ............ 3 - 22 3.1 2 multiply double - word instructions ................................ ............................. 3 - 22 3.1 3 divide instructions ................................ ................................ ....................... 3 - 24 3.1 4 shift left instructi ons ................................ ................................ ................... 3 - 26 3.1 5 shift right instructions ................................ ................................ ................. 3 - 27 3.1 6 rotate left instruction ................................ ................................ .................. 3 - 29 3.1 7 index move instructions ................................ ................................ ............... 3 - 20 3.1 8 check instructions ................................ ................................ ........................ 3 - 32 3.1 9 no operation instruction ................................ ................................ .............. 3 - 32 3. 20 compare instructions ................................ ................................ .................... 3 - 33 3.2 1 compare bit instructions ................................ ................................ .............. 3 - 34 3.2 2 t est leading zeros instruction ................................ ................................ ..... 3 - 34 3.2 3 set stack address instruction ................................ ................................ ....... 3 - 35 3.2 4 set conditional instructions ................................ ................................ ......... 3 - 35 3.2 5 branch instructions ................................ ................................ ....................... 3 - 37 3.2 6 delayed branch instructions ................................ ................................ ........ 3 - 39
table of contents iii 3.2 7 call instruction ................................ ................................ ............................ 3 - 41 3.2 8 trap instructions ................................ ................................ .......................... 3 - 43 3.2 9 frame i nstruction ................................ ................................ ......................... 3 - 45 3. 30 return instruction ................................ ................................ ........................ 3 - 48 3.3 1 fetch instruction ................................ ................................ .......................... 3 - 50 3.3 2 extended dsp instructions ................................ ................................ .......... 3 - 51 3.3 3 software instructions ................................ ................................ ................... 3 - 54 3.33.1 do instruction ................................ ................................ .................. 3 - 55 3.33.2 floating - point instructions ................................ .............................. 3 - 56 4. exceptions 4.1 exception processing ................................ ................................ ....................... 4 - 1 4.2 exception types ................................ ................................ .............................. 4 - 2 4.2.1 reset ................................ ................................ ................................ .... 4 - 2 4.2.2 range, pointer, frame and privilege error ................................ ......... 4 - 2 4.2.3 extended overflow ................................ ................................ .............. 4 - 3 4.2.4 parity error ................................ ................................ .......................... 4 - 3 4.2. 5 interrupt ................................ ................................ ............................... 4 - 3 4.2.6 trace exception ................................ ................................ ................... 4 - 4 4.3 exception backtracking ................................ ................................ ................... 4 - 4 5. timer and cpu clock modes 5.1 overview ................................ ................................ ................................ .......... 5 - 1 5.1.1 timer prescaler register tpr ................................ ............................. 5 - 1 5.1.2 timer register tr ................................ ................................ ............... 5 - 2 5.1.3 timer compare register tcr ................................ ............................ 5 - 3 5.1. 4 power - down mode ................................ ................................ ............. 5 - 3 5.1. 5 additional power saving ................................ ................................ ..... 5 - 4 5.1. 6 sleep mode ................................ ................................ .......................... 5 - 5
iv table of contents 6. bus interface 6.1 bus control general ................................ ................................ ......................... 6 - 1 6.1. 1 boot width selection ................................ ................................ ........... 6 - 2 6.1.2 sram and rom bus access ................................ .............................. 6 - 2 6.1. 3 dram bus access ................................ ................................ .............. 6 - 3 6.1. 3 .1 dram row address bits multiplexing ............................. 6 - 4 6.2 i/o bus control ................................ ................................ ................................ 6 - 5 6. 2 .1 i/o bus control ................................ ................................ .................... 6 - 6 6.3 bus control register bcr ................................ ................................ ............... 6 - 7 6.4 memory control register mcr ................................ ................................ ..... 6 - 1 1 6.4.1 memx parity disable ................................ ................................ ........ 6 - 1 3 6.4.2 memx wait disable ................................ ................................ .......... 6 - 1 3 6.4.3 memx byte mode ................................ ................................ ............. 6 - 1 3 6.4.4 power down ................................ ................................ ....................... 6 - 1 3 6.4.5 iram refresh test ................................ ................................ ............ 6 - 1 4 6.4.6 iram refresh rate ................................ ................................ ........... 6 - 1 4 6.4.7 dram type ................................ ................................ ...................... 6 - 1 4 6.4. 8 entry table map ................................ ................................ ................ 6 - 1 4 6.4. 10 memx bus size ................................ ................................ ............... 6 - 1 4 6.5 input status register isr ................................ ................................ ............... 6 - 1 5 6.6 function control register fcr ................................ ................................ ...... 6 - 1 6 6.7 watchdog compare register wcr ................................ ................................ 6 - 18 6.8 io3 control modes ................................ ................................ ......................... 6 - 18 6.8.1 io3standard mode ................................ ................................ ............. 6 - 18 6.8.2 watchdog mode ................................ ................................ ................. 6 - 18 6 .8.3 io3timing mode ................................ ................................ ............... 6 - 19 6.8.4 io3timerinterrupt mode ................................ ................................ ... 6 - 19 6.9 bus signals ................................ ................................ ................................ ..... 6 - 20 6.9.1 bus signals for the gms30c2232 processor ................................ .... 6 - 20 6.9.2 bus signals for the GMS30C2216 processor ................................ .... 6 - 2 1 6.9.3 bus signal description ................................ ................................ ....... 6 - 2 2 6.10 bus cycles ................................ ................................ ................................ .... 6 - 27 6. 10 .1 me mx byte mode =1 ................................ ................................ ...... 6 - 27 6.10.1.1 sram and rom single - cycle read access ................. 6 - 27 6.10.1.2 sram and rom single - cycle write access ................ 6 - 27 6.10.1.3 sram and rom multi - cycle read access .................. 6 - 28 6.10.1.4 sram multi - cycle write access ................................ .. 6 - 28 6. 10 . 2 memx byte mode =0 ................................ ................................ ...... 6 - 29 6.10.2.1 sram single - cycle read access ................................ .. 6 - 29 6.10.2.2 sram single - cycle write access ................................ . 6 - 29 6.10.2.3 sram multi - cycle read access ................................ ... 6 - 30
table of contents v 6.10.2.4 sram multi - cycle write access ................................ . 6 - 30 6. 10 . 3 mem2 read access with wait pin ................................ .............. 6 - 31 6. 10 . 4 i/o read access ................................ ................................ .............. 6 - 32 6. 1 0 . 5 i/o read access with wait pin ................................ .................... 6 - 33 6. 10 . 6 i/o write access ................................ ................................ ............. 6 - 34 6. 10 . 7 dram ................................ ................................ ............................. 6 - 35 6.10.7.1 fast page mode dram access ................................ ..... 6 - 35 6.10.7.2 edo dram single - cycle access ................................ . 6 - 36 6.10.7.3 edo dram multi - cycle access ................................ .. 6 - 37 6.10.7.4 dram refresh(cas before ras refre sh .................... 6 - 38 6.10 dc characteristics ................................ ................................ ....................... 6 - 3 9 7. mechanical data 7.1 gms30c2232, 160 - pin mqfp - package ................................ ....................... 7 - 1 7.1.1 pin configuration - view from top side ................................ ............ 7 - 1 7.1. 2 pin cross reference by pin name ................................ ...................... 7 - 2 7.1.3 pin cross reference by location ................................ ........................ 7 - 3 7.2 gms30c2232, 144 - pin tqfp - package ................................ ........................ 7 - 4 7.2.1 pin configuration - view from top side ................................ ............ 7 - 4 7.2.2 pin cross reference by pin name ................................ ...................... 7 - 5 7.2.3 pin cross reference by location ................................ ........................ 7 - 6 7.3 GMS30C2216, 100 - pin tqfp - package ................................ ........................ 7 - 7 7.3.1 pin configuration - view from top side ................................ ............ 7 - 7 7.3.2 pin cross reference by pin name ................................ ...................... 7 - 8 7.3.3 pin cross reference by location ................................ ........................ 7 - 9 7.4 package - dimensions ................................ ................................ ...................... 7 - 10 appendix. instruction set detai l

overview 0 - 1 0 . overview 0 . 1 GMS30C2216/32 risc/dsp the hme gms30c2232 and GMS30C2216 risc/dsp i s an improved version of hme ? s existing gms30c2132 and gms30c2116 risc/dsp. using a 0. 35 m cmos technology , the performance of the risc/dsp could be further improved. being pin - compatible to their predecessors , these new risc/dsp can be used as a direct r eplacement in existing customer ? s designs. the GMS30C2216 and gms30c2232 risc/dsp are based on hyper stone architecture. improved points maximum operating frequency : 108mhz @3.3v operating voltage : 3. 3v 0.3v 8kbyte on - chip memory on chip phase d locked loop circuit (x0.5, x1, x2, x4) boot bus width selectable by two external pins wait pin function on chip dram controller : fpm(fast - page - mode), (extended - data - out) edo drams. 5.0v tolerant input control clkout pin function this combinati on of a high - performance risc microprocessor with an additional powerful dsp instruction set and on - chip microcontroller functions offers a high throughput. the speed is obtained by an optimized combination of the following features: pipelined memory acc ess allows overlapping of memory accesses with execution. 8kbyte on - chip memory. on - chip instruction cache omits instruction fetch in inner loops and provides prefetch. variable - length instructions of 16, 32 or 48 bits provide a large, powerful in st ruction set, thereby reducing the number of instructions to be executed. primarily used 16 - bit instructions halve the memory bandwidth required for in struction fetch in comparison to conventional risc architectures with fixed - length 32 - bit instructions, yielding also even better code economy than conven tional cisc architectures. orthogonal instruction set most instructions execute in one cycle. pipelined dsp instructions. parallel execution of alu and dsp instructions. single - cycle halfword mu ltiply - accumulate operation. fast call and return by parameter passing via registers.
0 - 2 chapter 0 an instruction pipeline depth of only two stages ? decode/execute ? provides branching without insertion of wait cycles in combination with delayed branch instruction s. range and pointer checks are performed without speed penalty, thus, these checks need no longer be turned off, thereby providing higher runtime reliability. separate address and data buses provide a throughput of one 32 - bit word each cycle. the feat ures noted above contribute to reduce the number of idle wait cycles to a bare minimum. the processor is designed to sustain its execution rate with a standard dram memory. the low power consumption is of advantage for mobile (portable) applications or in temperature - sensitive environments. most of the transistors are used for the on - chip memory, the instruction cache, the register stack and the multiplier, whereas only a smallnumber is required for the control logic. due to their low system cost, the gms30 c2216 and gms3oc2232 risc/dsp are very well suited for embedded - systems applications requiring high performance and lowest cost. to simplify board design as well as to reduce system costs, the GMS30C2216 and gms30c2232 already come with integrated peripher y, such as a timer and memory and bus control logic. therefore, complete systems with the hme?s microprocessor can be implemented with a minimum of external components. to connect any kind of memory or i/o, no glue logic is necessary. it is even suitable f or systems where up to now microprocessors with 16 - bit architecture have been used for cost reasons. its improved performance compared to conventional microcontrollers can be used to software - substitute many external peripherals like graphics controllers o r dsps. the software development tools include an optimizing c compiler, assembler, source - level debugger with profiler as well as a real - time kernel with an extremely fast response time. using this real - time kernel, up to 31 tasks, each with its own virtu al timer, can be developed independently of each other. the synchronization of these tasks is effected almost automatically by the real - time kernel. to the developer, it seems as if he has up to 31 hme?s microprocessors to which he can allocate his program s accordingly. real - time debugging of multiple tasks is assisted in an optimized way. the following description gives a brief architectural overview: compatibility: pin compatible to hme gms30c2116/32, and hyper stone e1 - 16/32 pin and function compatibl e to hyper stone e1 - 16/32x pll(phased locked loop): an internal phased locked loop circuit (pll) provides clock rate multiplication by a factor of four, only an external crystal of 27mhz is required to achieve an internal clock rate of 108mhz.
overview 0 - 3 registers: 32 global and 64 local registers of 32 bits each 16 global and up to 16 local registers are addressable directly flags: zero(z), negative(n), carry(c) and overflow(v) flag interrupt - mode, interrupt - lock, trace - mode, trace - pending, supervisor state , cache - mode and high global flag register data types: unsigned integer, signed integer, signed short, signed complex short, 16 - bit fixed - point, bitstr ing, ieee - 754 floating - point, each either 32 or 64 bits external memory: address space of 4gbytes, di vided into five areas separate i/o address space load/store architecture pipelined memory and i/o accesses high - order data located and addressed at lower address (big endian) instructions and double - word data may cross dram page boundaries on - chi p memory: 8kbytes internal (on - chip) memory memory data types: unsigned and signed byte (8 bit) unsigned and signed halfword (16 bit), located on halfword boundary undedicated word (32 bit), located on word boundary undedicated double - word (64 bi t), located on word boundary runtime stack: runtime stack is divided into memory part and register part register part is implemented by the 64 local registers holding the most recent stack frame(s) current stack frame (maximum 16 registers) is always kept in register part of the stack data transfer between memory and register part of the stack is automatic upper stack bound is guarded
0 - 4 chapter 0 instruction cache: an on - chip instruction cache reduces instruction memory access substantially instructions gen eral: variable - length instructions of one, two or three halfwords halve required me mory bandwidth pipeline depth of only two stages, assures immediate refill after branches register instructions of type "source operator destination t destination" or "source operator immediate t destination" all register bits participate in an operation immediate operands of 5, 16 and 32 bits, zero - or sign - expanded large address displacement of up to 28 bits two sets of signed arit hme tical instructions: instr uctions set or clear either only the overflow flag or trap additionally to a range error routine on overflow dsp instructions operate on 16 - bit integer, real and complex fixed - point data and 32 - bit integer data into 32 - bit and 64 - bit hardware accumulator s instruction summary: memory instructions pipelined to a depth of two stages, trap on address register equal to zero (check for invalid pointers) memory address modes: register address, register postincrement, register + dis placement (including pc re lative), register postincrement by displacement (next address), absolute, stack address, i/o absolute and i/o displacement load, all data types, bytes and halfwords right adjusted and zero - or sign - expan ded, execution proceeds after load until data is n eeded store, all data types, trap when range of signed byte or halfword is exceeded move, move immediate, move double - word logical instructions and, and not, or, xor, not, and not immediate, or immediate, xor immediate mask source and immediate t d estination add unsigned/signed, add signed with trap on overflow, add with carry add unsigned/signed immediate, add signed immediate with trap on overflow sum source + immediate t destination, unsigned/signed and signed with trap on overflow subtra ct unsigned/signed, subtract signed with trap on overflow, subtract with carry negate unsigned/signed, negate signed with trap on overflow multiply word * word t low - order word unsigned or signed, multiply word * word t double - word unsigned and signed
overview 0 - 5 divide double - word by word t quotient and remainder, unsigned and signed shift left unsigned/signed, single and double - word, by constant and by content of register, shift left signed by constant with trap on loss of high - order bits shift right unsig ned and signed, single and double - word, by constant and by con tent of register rotate left single word by content of register index move, move an index value scaled by 1, 2, 4 or 8, optionally with bounds check check a value for an upper bound speci fied in a register or check for zero compare unsigned/signed, compare unsigned/signed immediate compare bits, compare bits immediate, compare any byte zero test number of leading zeros set conditional, save conditions in a register branch uncondi tional and conditional (12 conditions) delayed branch unconditional and conditional (12 conditions) call subprogram, unconditional and on overflow trap to supervisor subprogram, unconditional and conditional (11 conditions) frame, structure a new s tack frame, include parameters in frame addressing, set frame length, restore reserve frame length and check for upper stack bound return from subprogram, restore program counter, status register and return - frame software instruction, call an associate d subprogram and pass a source operand and the address of a destination operand to it dsp multiply instructions: signed and/or unsigned multiplication t single and double word product dsp multiply - accumulate instructions: signed multiply - add and multip ly - subtract t single and double word product sum and difference dsp halfword multiply - accumulate instructions: signed multiply - add operating on four halfword operands t single and double word product sum dsp complex halfword multiply instruction: signe d complex halfword multiplication t real and imaginary single word product dsp complex halfword multiply - accumulate instruction: signed complex halfword multiply - add t real and imaginary single word product sum
0 - 6 chapter 0 dsp add and subtract instructions: signe d halfword add and subtract with and without fixed - point adjustment t single word sum and difference floating - point instructions are architecturally fully integrated, they are executed as software instructions by the present version. floating - point add, subtract, multiply, divide, compare and compare unordered for single and double - preci sion, and convert single ? double are provided. exceptions: pointer, privilege, frame and range error, extended overflow, parity error, interrupt and trace mode excepti on watchdog function error - causing instructions can be identified by backtracking, thus allowing a very detailed error analysis timer: two multifunctional timers bus interface: separate address bus of 26 ( gms30c2232 ) or 22 ( GMS30C2216 ) bits and dat a bus of up to 32 ( gms30c2232 ) or 16 bits ( GMS30C2216 ) provide a throughput of four or two bytes at each clock cycle data bus width of 32, 16 or 8 bits, individually selectable for each external memory area. 8 - bit, 16 - bit, and 32 - bit boot width selecta ble via two external pins. 5v tolerant input configurable i/o pins internal generation of all memory and i/o control signals wait pin function for i/o accesses to peripheral devices. wait pin function for memory accesses to address space mem2. on - chip dram controller supporting fast - page - mode drams and edo drams. up to seven vectored interrupts control function for clkout pin. power management: operating voltage : 3.3v 0.3v. lower power supply current in power - down mode. clock - off fu nction to further reduce power dissipation (sleep mode)
overview 0 - 7 0 . 2 block diagram figure 0 . 1 : block diagram dsp execution unit hardware- multiplier store data pipeline instruction prefetch control unit databus parity alu barrel shifter z w a x y i memory address pipeline address bus control bus bus interface control unit bus pipeline control instruction cache control instruction cache load decode instruction decode 32 26 8 kbyte ram 12 x y pc instruction execution control unit interrupt control internal timer 32 watchdog power down+ reset control 4 (16) (22) 4 (2) register set 64 local 26 global x-decode y-decode x y
0 - 8 chapter 0 0 . 3 pin configuration 0 . 3 . 1 gms30c2232, 160 - pin mqfp - package - view from top side 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 108 107 106 105 104 103 102 101 100 99 98 96 95 94 93 92 91 90 89 88 87 86 85 84 121 122 123 124 125 126 127 128 129 130 131 132 133 97 48 47 46 45 44 43 42 41 71 70 69 68 67 66 65 64 63 62 49 50 a24 a23 gnd vcc a22 a8 a7 vcc a6 a5 a4 gnd we0# /be0# we1# /be1# vcc cas0# a14 gnd vcc act a13 gnd we# gnd vcc vcc d23 d22 gnd d5 d4 d3 vcc d2 d1 d0 vcc gnd d21 d20 d19 dp2 dp3 vcc gnd reset# grant# vcc gnd vcc vcc gnd io3 iowr# cs3# cs2# cs1# gnd ras# a19 vcc a20 a21 gnd d31 d30 d29 a9 a10 a11 a12 vcc d28 d27 d26 gnd we2# /be2# iord# oe# vcc cas3# cas2# cas1# gnd xtal1/clkin xtal2 io2 vcc d16 d17 d18 a3 a2 a1 a0 gnd dp1 dp0 83 82 81 bootw clkout io1 gnd rqst int4 int3 /wait int2 int1 gnd vcc 61 60 59 58 57 56 55 54 53 52 51 vcc gnd d9 gnd d8 d7 vcc gnd d6 d24 26 27 28 29 30 31 32 33 34 35 36 gnd d25 d15 d14 vcc d13 d12 d11 d10 gnd vcc 134 135 136 137 138 139 140 141 142 143 144 vcc gnd bootb a18 a17 gnd vcc a16 a15 a25 gnd 72 gnd vcc we3# /be3# nc nc nc nc 109 110 111 112 113 114 115 116 117 118 119 120 73 74 75 76 77 78 79 80 nc nc nc nc 37 38 39 40 nc nc nc nc 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 nc nc nc nc gms30c2 2 32 figure 0 . 2 : gms30c2232, 160 - pin mqfp - package
overview 0 - 9 0 . 3 . 2 pin cross refer ence by pin name signal location signal location signal location signal location a0 ................... 97 d 3 ..................... 5 9 gnd ................. 50 nc ................... 118 a1 ................... 98 d 4 ..................... 5 8 gnd ................. 56 nc ................... 123 a2 ................... 99 d 5 ..................... 57 gnd ................. 65 nc ................... 124 a3 ................. 100 d 6 ..................... 51 gnd ................. 68 nc ................... 157 a4 ................. 137 d 7 ..................... 48 gnd ................. 73 nc ................... 158 a5 ................. 138 d 8 ..................... 47 gnd ................. 79 oe # ................ 113 a6 ................. 139 d 9 ..................... 45 g nd ................. 82 ras # ................ 11 a7 ................. 141 d 10 ................... 36 gnd ................. 90 reset # ............ 74 a8 ................. 142 d 11 .................... 35 gnd ................. 96 rqst ................ 89 a9 ................... 20 d 12 ................... 34 gnd ............... 108 vcc .................... 1 a10 ................. 21 d 13 ................... 33 gnd ................ 119 vcc .................. 13 a11 ................. 22 d 14 ................... 31 gnd ............... 122 vcc .................. 24 a12 ................. 23 d 15 ................... 30 gnd ............... 126 vcc .................. 32 a13 ............... 127 d 16 ................. 103 gnd ............... 130 vcc .................. 40 a14 ............... 131 d 17 ................. 102 gnd ............... 136 vcc .................. 41 a15 ............... 15 0 d 18 ................. 101 gnd ............... 145 vcc .................. 49 a16 ............... 151 d 19 ................... 69 gnd ............... 148 vcc .................. 53 a17 ............... 154 d 20 ................... 67 gnd ............... 153 vcc .................. 60 a18 ............... 155 d2 1 ................... 66 gnd ............... 159 vcc .................. 64 a19 ................. 12 d2 2 ................... 55 grant# ........... 75 vcc .................. 72 a20 ................. 14 d2 3 ................... 54 int1 .................. 85 vcc .................. 76 a21 ................. 15 d2 4 ................... 52 int2 .................. 86 vcc .................. 80 a22 ............... 143 d2 5 ................... 29 int3 /wait ........ 87 vcc .................. 81 a23 ............... 146 d2 6 ................... 27 in t4 .................. 88 vcc ................ 104 a24 ............... 147 d2 7 ................... 26 io 1 .................... 91 vcc ................ 112 a25 ............... 149 d 28 ................... 25 io2 .................. 105 vcc ................ 120 act .............. 128 d 29 ................... 19 io3 ...................... 5 vcc ................ 121 bootb ......... 156 d 30 ................... 18 iord# ............. 114 vcc ................ 129 bootw .......... 93 d 31 ................... 17 iowr# ................ 6 vcc ................ 133 cas 0 # .......... 132 dp 0 ................... 94 nc ...................... 3 vcc ................ 140 cas 1 # .......... 109 dp 1 ................... 95 nc ...................... 4 vcc ................ 144 cas2# .......... 110 dp2 ................... 70 nc .................... 37 vc c ................ 152 cs s3 # ........... 111 dp3 ................... 71 nc .................... 38 vcc ................ 160 clkout ......... 92 gnd .................... 2 nc .................... 43 we# ................ 125 cs 1 # ................ 9 gnd .................. 10 nc .................... 44 we0# /be0# .... 135 cs2# ................. 8 gnd .................. 16 nc .................... 77 we1# /be1# .... 134 cs3# ................ 7 gnd .................. 28 nc .................... 78 we2# /be2# .... 115 d 0 ................... 63 gnd .................. 39 nc .................... 83 we3# /be3# .... 116 d 1 ................... 62 gnd .................. 42 nc .................... 84 xtal1/clkin . 107 d 2 ................... 61 gnd .................. 46 nc ................... 117 xtal2 ............. 106
0 - 10 chapter 0 0 . 3 . 3 pin function type name state use power vcc i power. connected to the power supply. it can be 3.3v power supply. gnd i ground. connected to the system ground. all gnd pins must be connected to the system ground. clock xtal1 i input for quartz clock. when the clock is generated by external clock generator, xtal1 is used as clock input. xtal2 o output for quartz clock. clkout o clock signal output. it can be used to supply a clock signal to peripheral devices. address bus a25..a0 o/z address bus. with the gms30c2232, only a22..a0 are connected to the address bus pins data bus d31..d0 i/o data bus. 32 - bit bidirectional data bus dp0..dp3 i/o data parity signal. bidirectional parity signa ls bus control ras# o/z row address strobe. ras# is activated when the processor accesses a dram or refresh cycle. when a sram is placed in mem0, ras# is used as the chip select signal cas0#..cas3# o/z column address strobe. they are only used by a dra m for column access cylices and for ?cas before ras? refresh. we# o/z write enable. active low indicates a write access, active high indicates a read access. cs1#..cs3# o/z chip select. active low of cs1#..cs3# indicates chip select for the memory area s mem1..mem3. we0#..we3# o/z sram write enable. active low indicates write enable for the corresponding byte. oe# o/z output enable for srams and eproms. iord# o/z i/o read strobe, optionally i/o data strobe. the use of iord# is specified in the i/o address bit 10. iowr# o/z i/o write strobe. bus control rqst o rqst signals the request for a memory or i/o access grant# i bus grant. grant# is signaled low by an bus arbiter to grant access to the bus for memory and i/o cycles act o active as bus master. act is signaled high when grant# is low and it is kept high during a current bus access interrupt int1..int4 i interrupt request a signal of int1..int4 interrupt request pins causes an interrupt exception when interrupt lock flag l is clear and th e corresponding intxmask bit in fcr is not set. i/o port io1..io3 i/o general input - output port. io1..io3 can be individually configured via ioxdirection bits in the fcr as either input or output pins (port). system control reset# i reset processor. rese t# low resets the processor to the initial state and halts all activity. reset# must be low for at least two cycles
architecture 1 - 1 1 . architecture 1 . 1 introduction 1 . 1 . 1 risc architecture in the early days of computer history, most computer families started with an instruction set which was rather simple. the main reason fo r being simple then was the high cost for hardware. the hardware cost has dropped and the software cost has gone up steadily in the past three decades. the net result is that more and more functions have been built into the hardware, making the instructio n set very large and very complex. the growth of instruction sets was also encouraged by the popularity of microprogrammed control in the 1960s and 1970s. even user - defined instruction sets were implemented using microcodes in some processors for special - p urpose applications. the evolution of computer architectures has been dominated by families of increasingly complex processors. under market pressures to preserve existing software, complex instruction set computer (cisc) architectures evolved by the gradu al addition of microcode and increasingly elaborate operations. the intent was to supply more support for high - level languages and operating systems, as semiconductor advances made it possible to fabricate more complex integrated circuits. it seemed self - e vident that architectures should become more complex as these technological advances made it possible to hold more complexity on vlsi devices. in recent years, however, reduced instruction set computer (risc) architectures have implemented a much more soph isticated handling of the complex interaction between hardware, firmware and software. risc concepts emerged from statistical analysis of how software actually uses the resources of a processor. dynamic measurement of system kernels and object modules gene rated by optimizing compilers show an overwhelming predominance of the simplest instruction, even in the code for cisc machine. complex instructions are often ignored because a single way of performing a complex operation needs of high - level language and s ystem environments. risc designs eliminate the microcoded routines and turn the low - level control of the machine over to software. this approach is not new. but its application is more universal in recent years thanks to the prevalence of high - level langua ges, the development of compilers that can optimize at the microcode level, and dramatic advances in semiconductor memory and packaging. it is now feasible to replace machine microcode rom with faster ram, organized as an instruction cache. machine control then resides in the instruction cache and is, in fact, customized on the fly. the instruction stream generated by system - and compiler - generated code provides a precise fit between the requirements of high - level software and the capabilities of the hardwa re. so compilers are playing a vital role in risc performance. the advantage of risc architecture is described as follows: simplicity made vlsi implementation possible and thus higher clock rates. hardwired control and separated data and program caches lower the average cpi (cycles per instruction) significantly.
1 - 2 chapter 1 dynamic instruction count in a risc program only increased slightly (less than 2) inordinary program. recently, the mips (million instructions per second) rate of a typical risc microproce ssor increased with a factor of 5/(2*0.1) = 25 times from that of a typical cisc microprocessor. the clock rate increased from 10 mhz on a cisc processor to 50 mhz on a cmos/ risc microprocessor. the instruction count in a typical risc program increase d less than 2 times form that of a typical cisc program. the average cpi for a risc microprocessor decreased to 1.2 (instead of 12 as in a typical cisc processor). 1 . 1 . 2 techniques to reduce cp i (cycles per instruction) if the work each instruction performs is simple and straightforward, the time required to execute each instruction can be shortened and the number of cycles reduced. the goal of risc designs has been to achieve an execution rate of one instruction per machine cycle (multiple - instruction - issue designs now seek to increase this rate to more than one instruction per cycle). techniques that help achieve this goal include: instruction pipelines load and store (load/store) architect ure delayed load instructions delayed branch instructions (1) instruction pipelines one way to reduce the number of cycles required to execute an instruction is to overlap the execution of multiple instructions. instruction pipelines divide the executi on of each instruction into several discrete portions and then execute multiple instructions simultaneously. the instruction pipeline technique can be likened to an assembled line - the instruction progresses from one specialized stage to the next until it is complete (or issued) - just as an automobile moves along an assembly line. (this is contrast to the nonpipeline, microcode approach, where all the work is done by one general unit and is less capable at each individual task.) for example, the execution of an instruction might be subdivided into four portions, or clock cycles, as shown in figure 1 .1: fetch instruction (f) alu operation (a) access memory (m) write results (w) cycle #1 cycle #2 cycle #3 cycle #1 figure 1 . 1 : functional division of a hypothetical pipeline
architecture 1 - 3 an instruction pipeline can potentially reduce the number of cy cles/instructions by a factor equal to the depth of the pipeline (the depth of the pipeline = the number of resource). for example, in figure 3 .2 each instruction still requires a total of four clock cycles to execute. however, if the four - level instructio n - pipeline is used, a new instruction can be initiated at each clock cycle and the effective execution rate is one cycle per instruction. f a m w #1 #2 #3 #4 f a m w f a m w f a m w clock cycles instruction figure 1 . 2 : multiple instructions in a hypothetical pipeline (2) load/store architect ure the discussion of the instruction pipeline illustrates how each instruction can be subdivided into several discrete parts that permit the processor to execute multiple instructions in parallel. for this technique to work efficiently, the time required to execute each instruction subpart should be approximately equal. if one part requires an excessive length of time, there is an unpleasant choice: either halting the pipeline (inserting wait or idle cycles), or making all cycles longer to accommodate this lengthier portion of the instruction. instructions that perform operations on operands in memory tend to increase either the cycle time or the number of cycles/instruction. such instruction require additional time for execution to calculate the addresses of the operands, read the required operands from memory, calculate the result, and store the results of the operation back to memory. to eliminate the negative impact of such instruction, risc designs implement a load and store (load/store) architecture in which the processor has many register, all operations are performed on operands held in processor registers, and main memory is accessed only by load and store instructions. this approach produces several benefits reducing the number of memory accesses eases memory bandwidth requirements limiting all operations to registers helps simplicity the instruction set eliminating memory operations makes it easier for compilers to optimize register allocation - this further reduces memory accesses and also r educes the instructions/task factor
1 - 4 chapter 1 all of these factors help risc design approach their goal of executing one cycle/instruction. however, two classes of instructions hinder achievement of this goal - load instructions and branch instructions. the followi ng sections discuss how risc designs overcome obstacles raised by these classes of instructions. (3) delayed load instructions load instruction read operands from memory into processor register for subsequent operation by other instructions. because memor y typically operates at much slower speeds than processor clock rates, the loaded operand is not immediately available to subsequent instructions in an instruction pipeline. the data dependency is illustrated in figure 1 .3. f a m w 1 2 3 4 f a m w f a m w f a m w data from load available as operation load instruction figure 1 . 3 : data dependency resulting from a load instruction in this illustration, the operand loaded by instruction 1 is not available for use in the a cycle (alu, or arithmetic/logic unit operation) of instruction 2. one way to handle this dependency i s to delay the pipeline by inserting additional clock cycles into the execution of instruction 2 until the loaded data becomes available. this approach obviously introduces delays that would increase the cycles/instructions factor. in many risc design the technique used to handle this data dependency is to recognize and make visible to compilers the fact that all load instructions have an inherent latency or load delay. figure 3 .3 illustrates a load delay or latency of one instruction. the instruction that immediately follows the load is in the load delay slot. if the instruction in this slot does not require the data from the load, and then no pipeline delay is required. if this load delay is made visible to software, a compiler can arrange instructions to ensure that there is no data dependency a load instruction and the instruction in the load delay slot. the simplest way of ensuring that there is no data dependency is to insert a no operation (nop) instruction to fill the slot, as follow: load r1, a loa d r2, b nop <= this instruction fills the delay slot add r3, r1, r2 although filling the delay slot with nop instructions eliminates the need for hardware - controlled pipeline stalls in this case, it still is not a very efficient use of the pipeline s tream
architecture 1 - 5 since these additional nop instructions increase code size and perform no useful work. (in practice, however, this technique need not have much negative impact on performance.) a more effective solution to handling the data dependency is to fill the load delay slot with a useful instruction. good optimizing compilers can usually accomplish this, especially if the load delay is only one instruction. below example program illustrates how a compiler might rearrange instruction to handle a potential data dependency. # consider the code for c := a+b; f := d load r1, a load r2, b add r2, r1, r2 <= this instruction stalls because r2 data is not available load r4, d ..... .... # an alternative code sequence (where delay length = 1) load r1, a load r2, b load r4, d add r3, r1, r2 <= no stall since r2 data is available (4) delayed branch instructions branch instructions usually delay the instruction pipeline because the processor must calculate the effective destination of the branch and fetch that in struction. when a cache access requires an entire cycle, and the fetched branch instruction specifies the target address, it is impossible to perform this fetch (of the destination instruction) without delaying the pipeline for at least one pipe stage (one cycle). conditional branches can cause further delays because they require the calculation of a condition, as well as the target address. instead of stalling the instruction pipeline to wait for the instruction at the target address, risc designs typical ly use an approach similar to that used with load instruction: branch instructions are delayed and do not take effect until after one or more instructions immediately following the branch instruction have been executed. the instruction or instructions imme diately following the branch instruction (delay instruction) have been executed. branch and delayed branch instruction are illustrated in figure 1 .4 next instruction branch target condition ? yes no next instruction branch target condition ? no delay instruction yes delayed branch branch instruction delayed branch instruction figure 1 . 4 : block diagram of branch/delayed branch instruction
1 - 6 chapter 1 1 . 1 . 3 the pipeline structure of gms30c2 2 32 gms30c2232 has a two - stage pipeline structure and each stage is composed of two phases (tm and tv). the basic structure of gms30c2232 pipeline is two - stage pipelin e, but actually it is lengthened by the need of some instruction. as a example, standard alu instruction uses 5 phases (2 stage pipeline (4 phases) + additional 1 phase). this additional phase doesn?t use the datapath which is used next instruction, so nex t instruction execution need not wait until previous alu instruction is ended. dsp instruction takes over 2 stage pipeline for execution, and requires same resource in the datapath which is required to next dsp instruction. so next dsp instruction is delay ed. the pipeline structure of gms30c2232 and the action of datapath is descri b ed in table 1.1. stage phase datapath action fetch/decode tm (low) 1. the instruction is read from the instruction cache according to the address of instruction. tv (high) 2. the control signal of rd (destination operand) and rs (source operand) is activated according to the instruction that was loaded in tm phase 2.1 the control signal of ir (immediate register (operand)) and il (instruction length) is activated. 2.2 the addr ess of next instruction is calculated and saved in pc execute/write tm (low) 1. the next instruction is read from the instruction cache. 1.1 the address of rs and rs are determined. 1.2 the immediate operand is determined. 1.3 the operand is read from reg ister stack using the address of rs and rd. 1.4 the operand xr, yr and qr are controlled. tv (high) 2. the input data of alu is attained. 2.1 the control of alu datapath is made and instruction is executed in alu. 2.2 the result of alu operation is saved in the register file. additional insertion next tm additional alu operation is continued and its result is saved in the register file. table 1.1: the pipeline structure of gms30c2232 and the action of datapath.
architecture 1 - 7 1 . 2 global register set the architecture provides 32 global registers of 32bit each. these are: g0 program counter pc g1 status register sr g2 floating - point exception register fer g3..g15 general purpose registers g16..g17 reserved g18 stack poi nter sp g19 upper stack bound ub g20 bus control register bcr (see section 6. bus interface ) g21 timer prescaler register tpr (see section 5. timer and cpu clock modes ) g22 timer compare register tcr (see section 5. timer and cpu clock modes ) g23 timer reg ister tr (see section 5. timer and cpu clock modes ) g24 watchdog compare register wcr (see section 6. bus interface ) g25 input status register isr (see section 6. bus interface ) g26 function control register fcr (see section 6. bus interface ) g27 memory co ntrol register mcr (see section 6. bus interface ) g28..g31 reserved registers g0..g15 can be addressed directly by the register code (0..15) of an instruction. registers g18..g27 can be addressed only by a mov or movi instruction with the high global flag h set to 1. (example) movi g2, 0x20 ; g2 := 0x20 (set h flag) mov g3, g19 ; g3 := g19 (g19 (ub) is copied to g3)
1 - 8 chapter 1 g0 0 31 0 g1 g2 g3 g15 g16 g17 g18 g19 g20 g21 g22 g23 g24 g25 g26 g27 program counter pc status register sr floating-point exception register fer reserved reserved general purpose registers g3..g15 stack pointer sp upper stack bound ub bus control register bcr timer prescaler register tpr timer compare register tcr timer register tr watchdog compare register wcr input status register isr function control register fcr memory control register mcr g28..g31 reserved 0 0 0 0 g28 g31 figure 1 . 5 : global register set 1 . 2 . 1 prog ram counter pc, g0 g0 is the program counter pc. it is updated to the address of the next instruction through instruction execution. besides this implicit updating, the pc can also be ad dressed like a regular source or destination register. when the pc is referenced as an operand, the supplied value is the address of the first byte after the instruction which references it (the address of next instruction), except when referenced by a delay instruction with a preceding delayed branch taken. at delay branch instruction, when the branch condition is met, place the branch address pc + rel (relative to the address of the first byte after the delayed branch instruction) in the pc (see section 1 .26. delayed branch instructions ). placing a result in the pc has the effect of a branch taken. when branch is taken, the target address of branch is placed in pc. bit zero of the pc is always zero, regardless of any value placed in the pc.
architecture 1 - 9 1 . 2 . 2 status register sr, g1 g1 is the status register sr. its content is updated by instruction execution. besides this implicit updating, the sr can also be addressed like a regular register (when h flag is set). when ad dressed as source or destination operand, all 32 bits are used as an op erand. however, only bits 15..0 of a result can be placed in bits 15..0 of the sr, bits 31..16 of the result are discarded and bits 31..16 of the sr remain unchanged. when sr addressed as source operand, it represents 0x0 value. the full content of the sr is replaced only by the return instruction. a result placed in the sr overrules any setting or clearing of the condition flags as a result of an instruction. frame pointer frame length 28 29 fl s p t trace-mode flag trace pending flag supervisor state flag instruction-length code 31 30 27 26 25 24 23 22 21 20 19 18 17 16 ilc fp figure 1 . 6 : status register sr (bits 31..16) floating-point rounding mode floating-point trap enable interrupt-mode flag high global flag cache-mode flag 12 13 fte v n z c carry flag zero flag negative flag overflow flag 15 14 11 10 9 8 7 6 5 4 3 2 1 0 m h frm l i reserved interrupt-lock flag figure 1 . 7 : status register sr (bits 15..0)
1 - 10 chapter 1 the status register sr contains the following status information: c carry flag. bit zero is the carry condition flag c. in general, when set it indicates that the unsigned i nteger range is exceeded (overflow). at add operations, it indicates a carry out of bit 31 of the result. at subtract operations, it indicates a bor row (inverse carry) into bit 31 of the result. z zero flag. bit one is the zero condition flag z. when set, it indicates that all 32 or 64 result bits are equal to zero regardless of any carry, borrow or overflow. n negative flag. bit two is the negative condition flag n. on compare instructions, it indicates the arithmetic correct (true) sign of the result reg ardless of an overflow. on all other instructions, it is derived from result bit 31, which is the true sign bit when no overflow occurs. in the case of overflow, result bit 31 and n reflect the inverted sign bit. v overflow flag. bit three is the overflow condition flag v. in general, when set it indicates a signed overflow. at the move instructions, it indicates a floating - point nan (not a number). m cache - mode flag. bit four is the cache - mode flag m. besides being set or cleared under pro gram control, it is also automatically cleared by a frame instruction and by any branch taken except a delayed branch. see section 1. 8 . instruction cache for details. h high global flag. bit five is the high global flag h. when h is set, denoting g0..g15 addres ses g16..g 31 instead. thus, the registers g18..g27 may be addressed by deno ting g2..g11 respectively. the h flag is effective only in the first cycle of the next instruction after it was set; then it is cleared automatically. only the mov or movi instruction issued as the next instructions must be used to copy the content of a local register or an immediate value to one of the high global registers. the mov instruction may be used to copy the content of a high global register (except the bcr, tpr, fcr and mcr regist er, which are write - only) to a local register. with all other instructions, the result may be invalid. if one of the high global registers is addressed as the destination register in user state (s = 0), the condition flags are undefined, the destination re gister remains unchanged and a trap to privilege error occurs. reserved bit six is reserved for future use. it must always be zero. i interrupt - mode flag. bit seven is the interrupt - mode flag i. it is set automatically on interrupt entry and reset to its o ld value by a return instruction. the i flag is used by the operating system; it must be never changed by any user program. fte floating - point trap enable flag. bits 12..8 are the floating - point trap enable flags they determine the exception type and trap execution flow(see section 3.33.2. floating - point instruc tions ). frm floating - point rounding mode. bits 14..13 are the floating - point rounding modes (see section 3.33.2. floating - point instruc tions ).
architecture 1 - 11 l interrupt - lock flag. bit 15 is the interrupt - lock f lag l. when the l flag is one, all interrupt, parity error and extended overflow exceptions are inhibited regardless of individual mode bits. the state of the l flag is effective immediately af ter any instruction which changed it. the l flag is set to on e by any exception. the l flag can be cleared or kept set in any or on return to any privilege state (user or supervisor). changing the l flag from zero to one is privi leged to supervisor or return from supervisor to supervisor state. a trap to privilege error occurs if the l flag is set under program control from zero to one in user or on return to user state. the following status information can not be changed by addressing the sr: t trace - mode flag. bit 16 is the trace - mode flag t. when both the t flag a nd the trace pen ding flag p are one, a trace exception occurs after every instruction except after a delayed branch instruction. the t flag is cleared by any exception. note: the t flag can only be changed in the saved return sr and is then effective afte r execution of a return instruction. p trace pending flag. bit 17 is the trace pending flag p. it is automatically set to one by all in structions except by the return instruction, which restores the p flag from bit 17 of the saved return sr. since for a t race exception both the p and the t flag must be one, the p flag determines whether a trace exception occurs (p = 1) or does not occur (p = 0) immediately after a return instruction that restored the t flag to one. when an instruction is ended, the t and p flag set to one. therefore trace exception is occurred. after trace exception trap is ended the process returns to main program, and if t and p flag is set to one, trace exception occurs again. to avoid tracing the same instruction in an endless loop, the p flag is cleared at return instruction in trace exception trap routine. note: the p flag can only be changed in the saved sr. no program except the trace exception handler should affect the saved p flag. the trace ex ception handler must clear the saved p flag to prevent a trace exception on return, in order to avoid tracing the same instruction in an endless loop. s supervisor state flag. bit 18 is the supervisor state flag s (see section 1.4. privilege states ). the s flag determine whether user state ( s=0) or supervisor state (s=1). it is set to one by any exception. ilc instruction - length code. bits 20 and 19 represent the instruction - length code ilc. it is updated by instruction execution. the ilc holds (in general) the length of the last in struction : ilc values of one, two or three represent an instruction length of one, two or three halfwords respectively. after a branch taken, the ilc is invalid. the return instruction clears the ilc. note: since a return instruction following an exception clears t he ilc, a program must not rely on the current value of the ilc. fl frame length. bits 24..21 represent the frame length fl. the fl holds the number of usable local registers (maximum 16) assigned to the current stack frame. fl = 0 is always interpreted as fl = 16.
1 - 12 chapter 1 fp frame pointer. bits 31..25 represent the frame pointer fp. the least significant six bits of the fp point to the beginning of the current stack frame in the local regi ster set, that is, they point to l0. the fp contains bit 8..2 of the addre ss at which the content of l0 would be stored if pushed onto the memory part of the stack. 1 . 2 . 3 floating - point exception register fer, g2 g2 is the floating - point exception register. all bits must be cleared to zero after reset. only bits 12..8 and 4..0 may be changed by a user program, all other bits must remain unchanged. reserved floating-point actual exceptions reserved for operating system floating-point accrued exceptions 12 13 11 10 9 8 7 6 5 4 3 2 1 0 31 figure 1 . 8 : floating - point exception register the floating - point trap enable flags fte and the exception fla gs are assigned as: floating - point trap enable fte accrued exceptions actual exceptions exception type sr(12) g2(4) g2(12) invalid operation sr(11) g2(3) g2(11) division by zero sr(10) g2(2) g2(10) overflow sr(9) g2(1) g2(9) underflow sr(8) g2(0) g2(8 ) inexact the reserved bits g2(31..13) and g2(7..5) must be zero. a floating - point instruction, except a floating - point compare, can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. fcmp and fcmpd can rais e only the invalid operation exception (at unordered). fcmpu and fcmpud cannot raise any exception.
architecture 1 - 13 at an exception, the following additional action is performed: any corresponding accrued - exception flag whose corresponding trap - enable flag is zero (not enabled) is set to one; all other accrued - exception flags remain un changed. if a corresponding trap - enable flag is one (enabled), any corresponding actual - ex - ception flag is set to one; all other actual - exception flags are cleared. the de stination rem ains unchanged. in the present software version, the software emulation routine must branch to the corresponding user - supplied exception trap handler. the (modified) result, the source operand, the stack address of the destination operand and the address of the floating - point instruction are passed to the trap handler. in the future hardware version, a trap to range error will occur; the range error handler will then initiate re - execution of the floating - point instruction by branching to the entry of the c orresponding software emulation routine, which will then act as described before. the only exceptions that can coincide are inexact with overflow and inexact with underflow. an overflow or underflow trap, if enabled, takes precedence over an in exact trap; the inexact accrued - exception flag g2(0) must then be set as well. 1 . 2 . 4 stack pointer sp, g18 g18 is the stack pointer sp. the sp contains the top address + 4 of the memory part of the stack, that is the addres s of the first free memory location in which the first local register would be saved by a push operation (see section 3.29. frame instruction for details). stack growth is from low to high address. bits one and zero of the sp must always be cleared to zero . the sp can be addres sed only via the high global flag h being set. copying an operand to the sp is a pri vileged operation. note: stack pointer sp contains the top address + 4 of the memory part of the stack (memory part stack), and frame pointer fp poi nts to the beginning of the current stack frame in the local register set (register part stack). 1 . 2 . 5 stack pointer sp, g18 g19 is the upper stack bound ub. the ub contains the address beyond the highest legal m emory stack location. it is used by the frame instruction to inhibit stack overflow. bits one and zero of the ub must always be cleared to zero. the ub can be addres sed only via the high global flag h being set. copying an operand to the ub is a pri vileg ed operation. 1 . 2 . 6 bus control register bcr, g20 g20 is the write - only bus control register bcr. its content defines the options possible for bus cycle, parity and refresh control. the bcr defines the parameters (bus timing, refresh control, page fault and parity error disable) for accessing external memory located in address spaces mem0..mem3. the bcr can be addres sed only via the high global flag h being set. copying an operand to the bcr is a pri vileged oper ation. the bcr register is described in detail in the bus interface descrip tion in section 6 .
1 - 14 chapter 1 1 . 2 . 7 timer prescaler register tpr, g21 g21 is the write - only timer prescaler register tpr. it adapts the timer clock to different processor clock frequencies. the tcr can be addres sed only via the high global flag h being set. copying an operand to the tpr is a pri vileged operation. the tpr is described in the timer description in section 5 . 1 . 2 . 8 timer compare register tcr, g22 g22 is the timer compare register tcr. its content is compared continuously with the content of the timer register tr. the tcr can be addressed only via the high global flag h being set. copying an op erand to the tcr is a pri vileged operation. the tcr is described in the timer description in section 5 . 1 . 2 . 9 timer register tr, g23 g23 is the timer register tr. its content is incremented by one on each time u nit. the tr can be addressed only via the high global flag h being set. copying an operand to the tr is a pri vileged operation. the tr is described in the timer description in section 5 . 1 . 2 . 10 watchdog compare register wcr, g24 g24 is the watchdog compare register wcr. the wcr can be addressed only via the high global flag h being set. the wcr is used by the io3 control mode (watchdog mode fcr(13) = 1, fcr(12) = 0). copying an operand to the wcr is a pri vileged operation. the wcr is described in the bus interface description in section 6 . 1 . 2 . 11 input status register isr, g25 g25 is the read - only input status register isr. the isr reflects the input levels at the pins io1..io3 as well as the input levels at the four interrupt pins int1..int4 and contains the evenflag and the equalflag. the isr can be addressed only via the high global flag h being set. the isr is described in the bus interface description in section 6 . 1 . 2 . 12 function control register fcr, g26 g26 is the write - only function control register fcr. the fcr controls the polarity and function of the i/o pins io1..io3 and the interrupt pins int1..int4, the timer inte rrupt mask and priority, the bus lock and the extended overflow exception. the fcr can be addressed only via the high global flag h being set. copying an operand to the fcr is a pri vileged operation. the fcr is described in the bus interface description i n section 6 . 1 . 2 . 13 memory control register mcr, g27 g27 is the write - only memory control register mcr. the mcr controls additional parameters for the external memory, the internal memory refresh rate, the mappin g of the entry table and the processor power management. the mcr can be addressed only via the high global flag h being set. copying an operand to the mcr is a pri vileged operation. the mcr is described in the bus interface description in section 6 .
architecture 1 - 15 1 . 3 local register set the architecture provides a set of 64 local registers of 32 bits each. the local regi sters 0..63 represent the register part of the stack, containing the most recent stack frame(s). 0 local register l0 local register l15 31 0 l0 l15 63 figur e 1 . 9 : local register set 0..63 the local registers can be addressed by the register code (0..15) of an instruction as l0..l15 only relative to the frame pointer fp; they can also be addressed absolutely as part of the stack i n the stack address mode (see section 3.1.1. address modes ). the absolute local register address is calculated from the register code as: absolute local register address := (fp + register code) modulo 64. that is, only the least significant six bits of the sum fp + register code are used and thus, the absolute local register addresses for l0..l15 wrap around modulo 64. the local register set organized as a circular buffer. the absolute local register addresses for fp + register code + 1 or fp + fl + offset are calculated accordingly. the least significant six bits of frame pointer fp point to the beginning of the current stack (l0).
1 - 16 chapter 1 1 . 4 privilege states the architecture provides two privilege states, determin ed by the supervisor state flag s: user state (s = 0) and supervisor state (s = 1). the privilege state may be used by an external memory management unit to control memory and i/o accesses. the operating system kernel is executed in the higher privileged s u pervisor state, thereby restricting access to all sensitive data to a highly reliable sy stem program. the following operations are also privileged to be executed only in the supervisor or on return from supervisor to supervisor state: copying an opera nd to any of the high global registers changing the interrupt - lock flag l from zero to one returning through a return instruction to supervisor state any illegal attempt causes a trap to privilege error. the s flag is also saved in bit zero of the save d return pc by the call, trap and software instructions and by an exception. at call instruction (call ld, rs, const) the old pc and the s flag is saved in ld and the old sr is saved in ldf. a return instruction restores it from this bit position to the s flag in bit position 18 of the sr (thereby overwriting the bit 18 returned from the saved return sr). if a return instruction attempts a return from user to supervisor state, a trap to privilege error occurs (s = 1 is saved). returning from supervisor to u ser state is achieved by clearing the s flag in bit zero of the saved return pc before return. switching from user to supervisor state is only possi ble by executing a trap instruction or by exception processing through one of the 64 supervisor subprogram entries (see section 2.4. entry tables ). note: since the return instruction restores the pc first to enable the instruction fetch to start immediately, the restored s flag must also be available immediately to prevent any memory access with a false privile ge state. the s flag is therefore packed in bit zero of the saved return pc. the state of the s flag can be signaled at the io1 pin in each memory or i/o cycle.
architecture 1 - 17 1 . 5 register data types 32 bits bitstring 31 msb lsb 0 s = sign bit, msb = most significant bit, lsb = least significant bit double-word bitstring 32-bit magnitude unsigned integer 31 msb lsb unsigned double-word integer 31-bit magnitude signed integer, two's complement 31 msb lsb s high-order 31-bit magnitude signed double-word integer, two's complement 31 lsb low-order 32-bit magnitude msb s 23-bit fraction single precision floating-point number 31 msb lsb 0 s 8-bit exponent high-order 20-bit fraction double precision floating-point number 31 lsb 0 low-order 32-bit fraction 11-bit exponent s msb register: complex signed short 31 msb lsb 0 s msb lsb s two signed shorts 31 msb lsb 0 s msb lsb s 15 15 real part imaginary part high-order 32-bit magnitude 31 lsb low-order 32-bit magnitude msb high-order 32-bits lsb low-order 32-bits msb n+1 n n n 0 n n n+1 0 n n n+1 n n+1 n n 0 0 31 0 figure 1 . 10 : register data types.
1 - 18 chapter 1 1 . 6 memory organization the architecture provides a memory address space in the range of 0..2 32 - 1 (0..4,294,967,295) 8 - bit bytes (4gbyte ). memory is implied to be organized as 32 - bit words. the fol lowing memory data types are available (see figure 3.12 ) byte unsigned (unsigned 8 - bit integer, bitstring or character) byte signed (signed 8 - bit integer, two's complement) halfword unsign ed (unsigned 16 - bit integer or bitstring) halfword signed (signed 16 - bit integer, two's complement) word (32 - bit undedicated word) double - word (64 - bit undedicated double - word) besides the memory address space, a separate i/o address space is provided . in the i/o address space, only word and double - word data types are available. words and double - words must be located at word boundaries, that is, their most signi ficant byte must be located at an address whose two least significant bits are zero (...xx0 0). halfwords must be located at halfword boundaries, their most significant byte being located at an address whose least significant bit is zero (...xx0). bytes may be located at any address. the variable - length instructions are located as contiguous sequ ences of one, two or three halfwords at halfword boundaries. memory - and i/o - accesses are pipelined to an implied depth of two addresses. note: all data is located high to low order at addresses ascending from low to high, that is, the high order part of a ll data is located at the lower address (big endian). this scheme should also be used for the addressing of bit arrays. though the most significant bit of a word is numbered as bit position 31 for convenience of use, it should be assigned the bit address z ero to maintain consistent bit addressing in ascending order through word boundaries. word address 8 4 0 0 1 2 3 4 5 6 7 8 9 10 11 0 1 2 3 4 5 6 7 8 9 10 11 31 24 23 16 15 8 7 0 31 24 23 16 15 8 7 0 big endian little endian word address 8 4 0 figure 1 . 11 : address of bytes within words: big - endian and little endian alignment.
architecture 1 - 19 figure 1 .12 shows the location of data and instructi ons in memory relative to a binary address n = ...xxx00 (x = 0 or 1). the memory organization is big - endian. 31 byte n byte n + 1 byte n + 2 byte n + 3 0 halfword n halfword n + 2 byte n byte n + 1 halfword n + 2 halfword n byte n + 2 byte n + 3 word n high-order word n of double-word low-order word n + 4 of double-word 1st instruction halfword 2nd instruction halfword (opt.) 3rd instruction halfword (opt.) preceding instruction 1st instruction halfword 2nd instruction halfword (opt.) 3rd instruction halfword (opt.) figure 1 . 12 : memory organization at all data types, the most significant bit is located a t the higher and the least sig nificant bit at the lower bit position.
1 - 20 chapter 1 1 . 7 stack a runtime stack, called stack here, holds generations of local variables in last - in - first - out (lifo) order. a generation of local variables, called stack frame or activation re cord, is created upon subprogram entry and released upon subprogram return. the runtime stack provided by the architecture is divided into a memory part and a register part. the register part of the sta ck, implemented by a set of 64 local regi sters organized as a circular buffer, holds the most recent stack frame(s). the current stack frame is always kept in the register part of the stack. the frame pointer fp points to the beginning of the current stac k frame (addressed as register l0). the frame length fl indicates the number of registers (maximum 16) assigned to the current stack frame. the stack grows from low to high address. it is guarded by the upper stack bound ub. the stack is maintained as foll ows: a call, trap or software instruction increments the fp and sets fl to six, thus creating a new stack frame with a length of six registers (including the return pc and the return sr). an exception increments the fp by the value of fl and then sets fl to two. a frame instruction restructures a stack frame to include (optionally) passed parameters by decrementing the fp and by resetting the fl to the desired length, and restores a re - serve of 10 local registers for the next subprogram call. if the r equired number of registers + 10 do not fit in the register part of the stack, the contents of the differential (required + 10 - available) number of local registers are pushed onto the memory part of the stack. a trap to frame error occurs after the push operation when the old value of the stack pointer sp exceeded the upper stack bound ub. the passed parameters are located from l0 to the required number of register to be saved passed parameters. note: a frame instruction must be executed before executing any other call, trap or software instruction or before the interrupt - lock flag l is being cleared, otherwise the beginning of the register part of the stack at the fp could be overwritten without any warning. a return instruction releases the current st ack frame and restores the preceding stack frame. if the restored stack frame is not fully contained in the register part of the stack, the content of the missing part of the stack frame is pulled from the memory part of the stack. for more details see the descriptions of the specific instructions. when the number of local registers required for a stack frame exceeds its maximum length of 16 (in rare cases), a second runtime stack in memory may be used. this second stack is also required to hold local recor d or array data. the stack is used by routines in user or supervisor state, that is, supervisor stack frames are appended to user stack frames, and thus, parameters can be passed be tween user and supervisor state. a small stack space must be reserved abov e ub. ub can then be set to a higher value by the frame error handler to free stack space for error handling. because the complete stack management is accomplished automatically by the hardware, programming the stack handling instructions is easy and does not require any knowledge of the internal working of the stack.
architecture 1 - 21 the following example demonstrates how the call, frame and return instructions are applied to achieve the stack behavior of the register part of the stack shown in the figures 1 .13 and 1 .14 . figure 3 .13 shows the creation and release of stack frames in the register part of the stack. program example: a: frame l13, l3 ; set frame length fl = 13, decrement fp by 3 : ; parameters passed to a can be addressed : ; in l0, l1, l2 : : code of function a : : mov l7, l5 ; copy l5 to l7 for use as parameter1 movi l8, 4 ; set l8 = 4 for use as parameter2 call l9, 0, b ; call function b, : ; save return pc, return sr in l9, l10 : : movi l0, 20 ; set l0 = 20 as return parameter for caller ret pc, l3 ; return to function calling a, ; restore frame of caller b: frame l11, l2 ; set frame length fl = 11, decrement fp by 2 : ; passed parameter1 can now be addressed in l0 : ; passed parameter2 can now be addressed in l1 : : code of function b : : ret pc, l2 ; return to function a, frame a is restored by ; copying return pc and return sr in l2 and l3 ; of frame b to pc and sr
1 - 22 chapter 1 figure 1.13 shows the creation and release of stack frames in the register part of stack return from b call b frame in b pc := ret. pc for b; pc := branch address; fp := fp - code of source reg.; sr := ret. sr for b; ret. pc for b := old pc; fl := code o f dest.reg.; -- returns preceding stack frame ret. sr for b := old sr; if available registers 3 if stack frame contained fp := fp + reg.code (required + 10) registers then in local registers then of ret. pc; next instruction next instruction; fl := 6; e lse else -- reg.code of ret. pc = 9 push contents of pull contents of differential words differential number of from memory part of the stack; registers to memory part of stack; -- code of source reg. = 2 -- code of dest.reg. = 11 l0 l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 l11 l12 l13 l14 l15 frame pointer (fp) current length of frame a fl = 13 parameters for must not be u sed fp+fl l0 l1 l2 l3 l4 l5 new fp current length of frame b fl = 6 parameters for frame b ret. pc for a ret. sr for a reserved for maximum number of variables in frame a ret. pc for b ret. sr for b fp+fl reserved for max. number of variables in frame b parameters for ret. pc for a ret. sr for a new fp current length of frame b fl = 11 parameters for frame b ret. pc for b ret. sr for b fp+fl parameters for ret. pc for a ret. sr for a reserved for max imum number of variables in frame b l0 l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 frame a frame a frame a before call b and after call l9, 0, dest; after frame l11, l2 after return figure 1 . 13 : stack frame handling (register part)
architecture 1 - 23 a currently activated function a has a frame length of fl = 13, fl = 3 (required to save passed parameters) + 10(received). registers l0..l6 are to be retained through a subsequent call, registers l7..l12 are temporaries. a call to function b needs 2 parameters to be passed. the parameters are placed by function a in register s l7 and l8 before calling b. the call instruction addresses l9 as destination for the return pc and return sr register pair to be used by function b on return to function a. on entry of function b, the new frame of b has an implicit length of fl = 6. it s tarts physically at the former register l9 of frame a. however, since the frame pointer fp has been incremented by 9 by the call instruction, this register location is now being addressed as l0 of frame b. the passed parameters cannot be addressed because they are located below the new register l0 of frame b. to make them addressable, a frame instruction decrements the frame pointer fp by 2. then, parameter 1 and 2 passed to b can be addressed as registers l0 and l1 respectively. note that the return pc is now to be addressed as l2! the frame instruction in b specifies also the new, complete frame length fl = 11 (including the passed parameters as well as the return pc and return sr pair). besides, a new reserve of 10 registers for subsequent function calls and traps is provided in the register stack. a possible overflow of the register stack is checked and handled automatically by the frame instruction. a program needs not and must not pay attention to register stack overflow. at the end of function b, a ret urn instruction returns control to function a and restores the frame a. a possible underflow of the register stack is handled also automatically; thus, the frame a is always completely restored, regardless whether it was wholly or partly pushed into the me mory part of the stack before (in the case when b called other functions). in the present example with the frame length of fl = 13, any suitable destination register up to l13 could be specified in the call instruction. the parameters to be passed to the f unction b would then be placed in l11 and l12. it is even possible to append a new frame to a frame with a length of fl = 16 (coded as fl = 0 in the status register sr): the destination register in the call instruction is then coded as l0, but interpreted as the register past l15. see also sections 3.27. call instruction , 3.29. frame instruction and 3.30. return instruction for further details. note: with an average frame length of 8 registers, ca. 7..8 frame instructions succeed a pulling return instructio n until a push occurs and 7..8 return instructions succeed a pushing frame instruction until a pull occurs. thus, the built - in hysteresis makes pushing and pulling a rare event in regular programs! figure 3 .14 represents the stack frame pushing and popping . when the register part of the stack a and x overlapped modulo 64 (the register part of stack was full), the frame instruction for frame x pushed the number of words in frame a to the memory part of the stack according to the space required for frame x. w hen the process returned to frame a, the return instruction pulled the number of words form the memory part of the stack to the register part of the stack.
1 - 24 chapter 1 register part of the stack a and x overlap modulo 64 memory part of the stack register part of the stack memory part of the stack before frame instruction for frame x after frame instruction for frame x a words to be pushed x additional space for x required pushed number of words according to space required for frame x stack space appended before return instruction to frame a after return instruction to frame a frame words for a required words to be overwritten words to be pulled pulled number of words completes stack frame a! frame words pulled stack space freed fp sp fp additional space for x available sp a x fp sp sp fp stack space required rest of frame a various frames various frames rest of frame a space available for x rest of frame a various frames a rest of frame a various frames = available part of a frame figure 1 . 14 : stack frame pushing and pop ping
architecture 1 - 25 1 . 8 instruction cache the instruction cache is transparent to programs. a program executes correctly even if it ignores the cache, whereby it is assumed that a program does not modify the instruction co de in the local range contained in the cache. the instruction cache holds a total of up to 128 bytes (32 unstructured 32 - bit words of instructions). it is implemented as a circular buffer that is guarded by a look - ahead counter and a look - back counter. the look - ahead counter holds the highest and the look - back counter the lowest address of the instruction words available in the cache. the cache - mode flag m is used to optimize special cases in loops (see details below). the cache can be regarded as a tempora ry local window into the instruction sequence, moving along with instruction execution and being halted by the execution of a program loop. its function is as follows: the prefetch control loads unstructured 32 - bit instruction words (without regard to inst ruction boundaries) from memory into the cache. the load operation is pipelined to a depth of two stages (see section 3.1. memory instructions for details of the load pipeline). the look - ahead counter is incremented by four at each prefetch cycle. it alway s contains the address of the last instruction word for which an address bus cycle is initiated, regardless of whether the addressed instruction word is in the load pipeline or already loaded into the instruction cache. the prefetched instruction word is p laced in the cache word location addressed by bits 6..2 of the look - ahead counter. the look - back counter remains unchanged during prefetch unless the cache word location it addresses with its bits 6..2 is overwritten by a prefetched instruction word. in th is case, it is incremented by four to point to the then lowest - addressed usable instruction word in the cache. since the cache is implemented as a circular buffer, the cache word addresses derived from bits 6..2 of the look - ahead and look - back counter wrap around modulo 32. the prefetch is halted: when eight words are prefetched, that is, eight words are available (including those pending in the load pipeline) in the prefetch sequence succeeding the instruction word addressed by the program counter pc t hrough the instruction word addressed by the look - ahead counter. prefetch is resumed when the pc is advanced by instruction execution. in the cycle preceding the execution cycle of an instruction accessing memory or i/o or any potentially branch - causing instruction (regardless of whether the branch is taken) except a forward branch or delayed branch instruction with an instruction length of one halfword and a branch target contained in the cache. halting the prefetch in these cases avoids filling the load pipeline with demands for potentially unnecessary instruction words. the prefetch is also halted during the execution cycle of any instruction accessing memory or i/o. the cache is read in the decode cycle by using bits 6..1 of the pc as an address to the first halfword of the instruction presently being decoded. the instruction decode needs and uses only the number (1, 2 or 3) of instruction halfwords defined by the instruction format. since only the bits 6..1 of the pc are used for addressing, the halfwo rd addresses wrap around modulo 64. idle wait cycles are inserted when the instruction is not or not fully available in the cache.
1 - 26 chapter 1 at an explicit branch or delayed branch instruction (except when placed as delay instruction) with an instruction length of one halfword, the location of the branch target is checked. the branch target is treated as being in the cache when the target address of a backward branch is not lower than the address in the look - back counter and the target address of a forward branch i s not higher than two words above the address in the look - ahead counter. that is, the two instruction words succeeding the instruction word addressed by the content of the look - ahead counter are treated by a forward branch as being in the cache. their actu al fetch overlaps in most cases with the execution of the branch instruction and thus, no cycles are wasted. when the branch target is in the cache, the look - back counter and the look - ahead counter remain unchanged. when a branch is taken by a delayed bra nch instruction with an instruction length of one halfword to a forward branch target not in the cache and the cache mode flag m is enabled (1), the look - back counter and the look - ahead counter remain unchanged. wait cycles are then inserted until the ongo ing prefetch has loaded the branch target instruction into the cache. any other branch taken flushes the cache by placing the branch address in the look - back and the look - ahead counter. prefetch then starts immediately at the branch address. instruction de coding waits until the branch target instruction is fully available in the cache. the cache mode flag m (bit four of the sr) can be set or cleared by logical instructions. it is automatically cleared by a frame instruction and by any branch taken except a branch caused by a delayed branch or return instruction; a delayed branch instruction leaves the m flag unchanged and a return instruction restores the m flag from the saved status register sr. note: since up to eight instruction words can be loaded into the cache by the prefetch, only 24 instruction words are left to be contained in a program loop. thus, a program loop can have a maximum length of 96 or 94 bytes including the branch instruction closing the loop, depending on the even or odd halfword addr ess location of the first instruction of the loop respectively. a forward branch or delayed branch instruction with an instruction length of one halfword into up to two instruction words succeeding the word addressed by the look - ahead counter treats the b ranch target as being in the cache and does not flush the cache. thus, three or four instruction halfwords, depending on the odd or even halfword address location of the branch instruction respectively, can always be skipped without flushing the cache . en abling the cache - mode flag m is only required when a program loop to be contained in the cache contains a forward branch to a branch target in the program loop and more than three (or four, see above) instruction halfwords are to be skipped. in this case, the enabled m flag in combination with a delayed branch instruction with an instruction length of one halfword inhibits flushing the cache when the branch target is not yet prefetched.
architecture 1 - 27 since a single - word memory instruction halts the prefetch for two cyc les, any sequence of memory instructions, even with interspersed one - cycle non - memory instructions, halts the prefetch during its execution. thus, alternating between instruction and data memory pages is avoided. if the number of instruction halfwords requ ired by such a sequence is not guaranteed to be in the cache at the beginning of the sequence, a fetch instruction enforcing the prefetch of the sequence may be used. a fetch instruction may also be used preceding a branch into a program loop; thus, flushi ng the cache by the first branch repeating the loop can be avoided. a branch taken caused by a branch or delayed branch instruction with an instruction length of two halfwords always flushes the instruction cache, even if the branch target is in the cache . thus, branches can be forced to bypass the cache, thereby reducing the cache to a prefetch buffer. this reduced function can be used for testing. 1 . 9 on - chip memory (iram) 8kbytes of memory are provided on - chip. the on - chip - memory (iram) is mapped to the hex address c000 0000 of the memory address space and wraps around modulo 8k up to dfff ffff. the iram is implemented as dynamic memory, needing refresh (dram). the refresh rate must be specified in the mcr bits 18..16 (see section 6.4. memory control register mcr) before any use (default is refresh disabled). the number given in mcr(18..16) specifies the refresh rate in cpu clock cycles; e.g. 128 specifies a refresh cycle automatically inserted every 128 clo ck cycles. each refresh cycle refreshes 16 bytes, thus, 256 refresh cycles are required to refresh the whole iram. a high refresh rate does not degrade performance since the refresh cycles are inserted on idle iram cycles whenever possible. an access to th e iram bypasses the access pipeline of the external memory. thus, pending external memory accesses do not delay accesses to the iram. the iram can hold data as well as instructions. instruction words from the iram are automatically transferred to the instr uction cache on demand; these transfers do not interfere with external memory accesses. besides bypassing of the external memory pipeline, memory instructions accessing the iram behave exactly alike those accessing external memory. the minimum delay for a load access is one cycle; that is, the data is not available in the cycle after the load instruction. one or more wait cycles are automatically inserted if the target register of the load is addressed before the data is loaded into the target register. at tention: for selection between an internal and external memory access, bits 31..29 of the specified address register are used before calculation of the effective address. therefore, the content of the specified address register must point into the iram add ress range. the iram address range boundary must not be crossed when the effective memory address is calculated in the displacement address mode.

instruction general 2 - 1 2 . instructions g eneral 2 . 1 instruction notation in the following instruction - set presentation, an informal description of an instruction is followed by a formal description in the form: format notation operation format deno tes the instruction format. notation gives the assembler notation of the instruction. operation describes the operation in a pascal - like notation with the following symbols: ls denotes any of the local registers l0..l15 used as source register or as source operand. at memory load instructions, ls denotes the load destination register. ld denotes any of the local registers l0..l15 used as destination register or as destination operand. rs denotes any of the local registers l0..l15 or any of the global regist ers g0..g15 used as source register or as source operand. at memory load, see ls. rd denotes any of the local registers l0..l15 or any of the global registers g0..g15 used as destination register or as destination operand. lsf, ldf, rsf and rdf denote the register or operand following after (with a register address one higher than) ls, ld, rs and rd respectively. imm, const, dis, lim, rel, adr and n denote immediate operands (constants) of various formats and ranges. operand(x) denotes a single bit at the b it position x of an operand. example: ld(31) denotes bit 31 of ld. operand(x..y) denotes bits x through y of an operand. example: ls(4..0) denotes bits 4 through 0 of ls. expression^ denotes an operand at a location addressed by the value of the expression . depending on the context, the expression addresses a memory location or a local register. example: ld^ denotes a memory operand whose memory address is the operand ld. (fp + fl)^ denotes a local register operand whose register address is fp + fl. : = si gnifies the assignment symbol, read as "is replaced by". // signifies the concatenation symbol. it denotes concatenation of two operand words to a double - word operand or concatenation of bits and bitstrings. examples: ld//ldf denotes a double - word operand, 16 zeros//imm1 denotes expanding of an immediate half - word by 16 leading zeros. =, 1 , > and < denote the equal, unequal, greater than and less than relations. example: the relation ld = 0 evaluates to one if ld is equal to zero, otherwise it evaluates to zero.
3 - 2 chapter 3 2 . 2 instruction execution on instruction execution, all bits of the operands participate in the operations, except on the shift and rotate instructions (whereat only the 5 least significant bits of the source operand are used) and except on the byte and half - word store instructions. instruction pipeline is as follows: instructions are executed by a two - stage pipeline . in the first stage, the instruction is fetched from the instruction cache and decoded. in the second stage, the instruction is executed while the next instruction in the first stage is already decoded. register instructions are as follows: on register instructions executing in one or two cycles, the corresponding source and destination opera nd words are read from their registers and evaluated in each cycle in which they are used. then the result word is placed in the corresponding destination register in the same cycle. thus, on all single - word register instructions executing in one cycle, th e source operand register and the destination operand register may coincide without changing the effect of the instruction. on all other instructions, the effect of a register coincidence depends on execution order and must be examined specifically for eac h such instruction. the content of a source register remains unchanged unless it is used coincidentally as a destination register (except on memory load instructions). conditional flags are changed: some instructions set or clear condition flags according to the result and special conditions occurring during their execution. the conditions may be expressed by single bits, relations or logical combinations of these. if a condition evaluates to one (true), the corresponding condition flag is set to one, if it evaluates to zero (false), the corresponding condition flag is cleared to zero. a trap to range error may occur if the specific flags and the destination are updated. all instructions may use the result and any flags updated by the preceding instruction. a time penalty occurs only if the result of a memory load instruction is not yet available when needed as destination or source operand. in this case one or more (depending on the memory access time) idle wait cycles are enforced by a hardware interlock. u sing local registers are as follows: an instruction must not use any local register of the register sequence beginning with l0 beyond the number of usable registers specified by the current value of the frame length fl (fl = 0 is interpreted as fl = 16). t hat is, the value of the corresponding register code (0..15) addressing a local register must be lower than the interpreted value of the fl (except with a call or frame instruction or some restricted cases). otherwise, an exception could overwrite the cont ents of such a register or the beginning of the register part of the stack at the sp could be overwritten without any warning when a result is placed in such a register. double - word instructions denote the high - order word (at the lower address). the low - or der word adjacently following it (at the higher address) is implied. "old" denotes the state before the execution of an instruction.
instruction general 2 - 3 2 . 3 instruction formats instructions have a length of one, two or three ha lf - words and must be located on half - word boundaries. the following formats are provided: format ll lr rr ln rn pcadr pcrel pcrel op-code ld-code ls-code op-code n ld-code n op-code d n rd-code n op-code adr-byte op-code 0 low-rel s op-code 1 high-rel low-rel s 9 15 8 7 4 3 0 10 9 15 8 7 4 3 0 9 15 8 7 4 3 0 15 8 7 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld rs-code encodes g0..g15 for rs rs-code encodes l0..l15 for rs ld-code encosed l0..l15 for ld rs-code encodes g0..g15 for rs rs-code encodes l0..l15 for rs rd-code encodes g0..g15 for rd rd-code encodes l0..l15 for rd ld-code encodes l0..l15 for ld bit 8//bits 3..0 encode n = 0..31 rd-code encodes g0..g15 for rd rd-code encodes l0..l15 for rd bit 8//bits 3..0 encode n = 0..31 adr = 24 ones's//adr-byte(7..2)//00 sign bit of rel rel = 9 s//high-rel//low-rel//0 range -8 388 608..8 388 606 sign bit of rel rel = 25 s//low-rel//0 range -128..126 10 9 15 8 7 4 3 0 15 8 7 0 6 1 15 8 7 0 6 1 op-code d s rd-code rs-code 15 8 7 4 3 0 op-code s ld-code rs-code configuration s: s: d = 0: d = 1: n: n: s = 0: s = 1: d = 0: d = 1: s = 0: s = 1: llext op-code op-code extension 15 8 ld-code ls-code 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld op-code extension encodes the extend instructions table 2 . 1 : instruction formats, part 1
3 - 4 chapter 3 configuration lrconst rrconst 9 15 8 7 4 3 0 rs-code encodes g0..g15 for rs rs-code encodes l0..l15 for rs ld-code encodes l0..l15 for ld sign bit of const const = 18 s//const1 range -16 384..16 383 const = 2 s//const1//const2 range -1 073 741 824..1 073 741 823 rs-code encodes g0..g15 for rs rs-code encodes l0..l15 for rs rd-code encodes g0..g15 for rd rd-code encodes l0..l15 for rd sign bit of const const = 18 s//const 1 range -16 384..16 383 const = 2 s//const1//const2 range -1 073 741 824..1 073 741 823 rd-code encodes g0..g15 for rd rd-code encodes l0..l15 for rd bit 8//bits 3..0 encode n = 0..31 see table 2.3. encoding of immediate values for encoding of imm 10 9 15 8 7 4 3 0 d op-code s ld-code rs-code op-code s rd-code rs-code rrdis 10 9 15 8 7 4 3 0 d op-code s rd-code rs-code rs-code encodes g0..g15 for rs rs-code encodes l0..l15 for rs rd-code encodes g0..g15 for rd rd-code encodes l0..l15 for rd sign bit of dis dis = 20 s//dis1 range -4 096..4 095 dis = 4 s//dis1//dis2 range -268 435 456..268 435 455 d-code, d13..d12 encode data types at memory instructions 10 9 15 8 7 4 3 0 d op-code n rd-code n 10 9 15 8 7 4 3 0 d op-code s rd-code rs-code rs-code encodes g0..g15 for rs rs-code encodes l0..l15 for rs rd-code encodes g0..g15 for rd rd-code encodes l0..l15 for rd x-code, x14..x12 encode index instructions lim = 20 zeros//lim1 range 0..4 095 lim = 4 zeros//lim1//lim2 range 0..268 435 455 14 14 14 rimm rrlim e s const1 const2 e const1 const2 e s s d d dis1 dis2 imm1 imm2 e x x x lim1 lim2 format s = 0: s = 1: s: e = 0: e = 1: s = 0: s = 1: d = 0: d = 1: s: e = 0: e = 1: s = 0: s = 1: d = 0: d = 1: s: e = 0: e = 1: dd: d = 0: d = 1: n: s = 0: s = 1: d = 0: d = 1: xxx: e = 0: e = 1: 14 table 2 . 2 : instruction formats, part 2
instruction general 2 - 5 2 . 3 . 1 table of immediate values n immediate value imm comment 0..1 6 0..16 at cmpbi, n = 0 encodes anybz at addi and addsi n = 0 encodes cz 17 imm1//imm2 range = 0..2 3 2 - 1 or - 2 31 ..2 31 - 1 18 16 zeros//imm1 range = 0..65 535 19 16 ones//imm1 range = - 65 536.. - 1 20 32 bit 5 = 1, all other bits = 0 21 64 bit 6 = 1, all other bits = 0 22 128 bit 7 = 1, all other bits = 0 23 2 31 bit 31 = 1, all other bits = 0 24 - 8 25 - 7 26 - 6 27 - 5 28 - 4 29 - 3 30 - 2 31 2 31 - 1 at cmpbi and andni bit 31 = 0, all other bits = 1 31 - 1 at all other instructions using imm table 2 . 3 : encoding of immediate values note: 2 31 provides clear, set and inve rt of the floating - point sign bit at andni, ori and xori respectively. 2 31 - 1 provides a test for floating - point zero at cmpbi and extraction of the sign bit at andni. see cmpbi for anybz and addi, addsi for cz.
3 - 6 chapter 3 2 . 3 . 2 table of instruction codes chk, chkz, nop xmx, xmxz cmp movd, ret mask mov andn divu sum add or divs xor subs addsi sub neg addi ori and movi andni cmpi cmpbi shrdi shr ldxx.d/a/iod/ioa shri fsubd dbe be bne faddd fadd dbnv dbv bnv ldw.r ldd.r sardi sar ldxx.n/s fdiv fdivd bse bht fmul dbnc dbc bc stxx.d/a/iod/ioa shli fcmpud dble ble bgt fcmpd dbnn dbn bnn stw.r std.r rol stxx.n/s mul extend do call fcvtd fcvt frame dbr stw.p std.p trapxx, trap 2 3 0 6 5 4 b 9 8 d c f e op-code bits 11..8 a b c d e f op-code bits 15..12 table 2 . 4 : table of instruction codes
instruction general 2 - 7 2 . 3 . 3 table of extended dsp instruction codes the extended dsp instructions are speci fied by a 16 - bit op - code extension succeeding the instruction op - code for the extend instruction. see section 3.32. extended dsp instructions . instructio n op - code extension (hex) emul 0100 emulu 0104 emuls 0106 emac 010a emacd 010e emsub 011a emsubd 011e ehmac 002a ehmacd 002e ehcmuld 0046 ehcmac d 004e ehcsum d 0086 ehcfftd 0096 table 2 . 5 : extended dsp instruction codes
3 - 8 chapter 3 2 . 4 entry tables spacing of the entries for the trap instructions and exceptions is four bytes. these entries are intended to each contain an instruction branching to the associated function. the entries for the trapxx instructions are the same as for trap. table 2 . 6 shows t he trap entries when the entry table is mapped to the end of memory area mem3 (default after reset): address (hex) entry description ffff ff00 trap 0 ffff ff04 trap 1 : : ffff ffc0 trap 48 io2 interrupt -- priority 15 ffff ffc4 trap 49 io1 inte rrupt -- priority 14 ffff ffc8 trap 50 int4 interrupt -- priority 13 ffff ffcc trap 51 int3 interrupt -- priority 11 ffff ffd0 trap 52 int2 interrupt -- priority 9 ffff ffd4 trap 53 int1 interrupt -- priority 7 ffff ffd8 trap 54 io3 interrupt -- priority 5 ffff ffdc trap 55 timer interrupt -- priority selectable as 6, 8, 10, 12 ffff ffe0 trap 56 reserved -- priority 17 (lowest) ffff ffe4 trap 57 trace exception -- priority 16 ffff ffe8 trap 58 parity error -- priority 4 ffff ffec trap 59 extended overflow -- priority 3 ffff fff0 trap 60 range, pointer, frame and privilege error -- priority 2 ffff fff4 trap 61 reserved -- priority 1 ffff fff8 trap 62 reset -- priority 0 (highest) ffff fffc trap 63 error entry for instruction code o f all ones table 2 . 6 : trap entry table mapped to the end of mem3
instruction general 2 - 9 table 2 . 7 shows the trap entries when the entry table is mapped to the beginning of memory areas mem0, mem1, mem2 or iram. x is 0 , 4, 8 or c corresponding to the mapping to mem0, mem1, mem2 or iram respectively. address (hex) entry description x000 0000 trap 63 error entry for instruction code of all ones x000 0004 trap 62 rese t -- priority 0 (highest) x000 0008 trap 61 reserv ed -- priority 1 x000 000c trap 60 range, pointer, frame and privilege error -- priority 2 x000 0010 trap 59 extended overflow -- priority 3 x000 0014 trap 58 parity error -- priority 4 x000 0018 trap 57 trace exception -- priority 16 x000 001c tr ap 56 reserved -- priority 17 (lowest) x000 0020 trap 55 timer interrupt -- priority selectable as 6, 8, 10, 12 x000 0024 trap 54 io3 interrupt -- priority 5 x000 0028 trap 53 int1 interrupt -- priority 7 x000 002c trap 52 int2 interrupt -- priori ty 9 x000 0030 trap 51 int3 interrupt -- priority 11 x000 0034 trap 50 int4 interrupt -- priority 13 x000 0038 trap 49 io1 interrupt -- priority 14 x000 003c trap 48 io2 interrupt -- priority 15 : : x000 00f8 trap 1 x000 00fc trap 0 table 2 . 7 : trap entry table mapped to the beginning of mem0, mem1, mem2 or iram
3 - 10 chapter 3 table 2 . 8 below shows the addresses of the first instruction of the emulator code associated with the floating - point inst ructions when the trap entry tables are mapped to the end of memory area mem3. spacing of the entries for the software instructions fadd..do is 16 bytes. address (hex) entry description ffff fe00 fadd floating - point add, single word ffff fe10 faddd float ing - point add, double - word ffff fe20 fsub floating - point subtract, single word ffff fe30 fsubd floating - point subtract, double - word ffff fe40 fmul floating - point multiply, single word ffff fe50 fmuld floating - point multiply, double - word ffff fe60 fdiv floating - point divide, single word ffff fe70 fdivd floating - point divide, double - word ffff fe80 fcmp floating - point compare, single word ffff fe90 fcmpd floating - point compare, double - word ffff fea0 fcmpu floating - point compare unordered, single word ffff feb0 fcmpud floating - point compare unordered, double - word ffff fec0 fcvt floating - point convert single word t double - word ffff fed0 fcvtd floating - point convert double - word t single word ffff fee0 reserved ffff fef0 do do instruction table 2 . 8 : floating - point entry table mapped to the end of mem3
instruction general 2 - 11 table 2 . 9 below shows the addresses of the first instruction of the emulator code associated with the floating - point instructions when the tr ap entry tables are mapped to the beginning of memory areas mem0, mem1, mem2 or iram. x is 0, 4, 8 or c corresponding to the mapping to mem0, mem1, mem2 or iram respectively. address (hex) entry description x000 010c do do instruction x000 011c reserved x000 012c fcvtd floating - point convert double - word t single word x000 013c fcvt floating - point convert single word t double - word x000 014c fcmpud floating - point compare unordered, double - word x000 015c fcmpu floating - point compare unordered, single wo rd x000 016c fcmpd floating - point compare, double - word x000 017c fcmp floating - point compare, single word x000 018c fdivd floating - point divide, double - word x000 019c fdiv floating - point divide, single word x000 01ac fmuld floating - point multiply, dou ble - word x000 01bc fmul floating - point multiply, single word x000 01cc fsubd floating - point subtract, double - word x000 01dc fsub floating - point subtract, single word x000 01ec faddd floating - point add, double - word x000 01fc fadd floating - point add, si ngle word table 2 . 9 : floating - point entry table mapped to the beginning of mem0, mem1, mem2 or iram
3 - 12 chapter 3 2 . 5 instruction timing the following execution times are given in number of processor clock cycles. all instructions not shown below: 1 cycle move double - word: 2 cycles shift double - word: 2 cycles test leading zeros: 2 cycles multiply word: when both operands are in the range of - 2 15 ..2 15 - 1: 4 cycles all other cases: 5 cycles mul tiply double - word signed: when both operands are in the range of - 2 15 ..2 15 - 1: 5 cycles all other cases: 6 cycles multiply double - word unsigned: when both operands are in the range of 0..2 16 - 1: 4 cycles all other cases: 6 cycles divide unsigned and signed: 36 cycles branch instructions when branch not taken: 1 cycle when branch taken and target in on - chip cache: 2 cycles when branch taken and target in memory : 2 + memory read latency cycles (see next page) delayed branch instructions when branch not taken: 1 cycle when branch taken and target in on - chip cache: 1 cycle when branch taken and target in memory: 1 + memory read latency cycles exceeding (delay instruction cycles - 1) call and trap instructions when branch not taken: 1 cycle when branch taken: 2 + memory read latency cycles software instructions: 6 + memory read latency cycles exceeding 4 cycles frame when not pushing words on the stack: 3 cycles additionally when pushing n words on the stack: memory write latency cycles + n * bus cycles per access -- write latency = cycles elapsed until write access cycle of first word stored (minimum = 1 at a non - ras access and no pipeline congestion) return: 4 + memory read latency cycles exceeding 2 cycles additionally when pulling n words from the stack: memory ras latency + n * bus cycles per access (ras latency applies only at n > 2, otherwise ras latency is always 0) -- ras latency = ras precharge cycles + ras to cas delay cycles
instruction general 2 - 13 fetch instruction: when the required number of instruction half - words is already prefetched in the instruction cache: 1 cycle otherwise 1 + (required number of half - words - number of half - words already prefetched)/2 * bus cycles per access memory word instructions, non - stack address mode: 1 cycle memory word instructions, stack addres s mode: 3 cycles memory double - word instructions: 2 cycles for timing calculations, double - word memory instructions are treated like a sequence of two single - word memory instructions. idle wait cycles are transparently inserted when a memory instruction ha s to wait for execution because the two - stage address pipeline is full. instruction execution proceeds after the execution of a load instruction until the data requested is needed (that is, the register into which the data is to be loaded is addressed) by a further instruction. the cycles executed between the memory instruction cycle requesting the data and the first cycle at which the data are available are called read latency cycles. these read latency cycles can be filled with instructions that do not ne ed the requested data. when, after the execution of these optional fill instruction cycles, the data is still not available in the cycle needing it, idle wait cycles are inserted until the data is available. the idle wait cycles are inserted transparently to the program by an on - chip hardware interlock. the read latency is: on an iram access: read latency = 1 cycle on a non - ras external memory or i/o access: read latency = address setup cycles + access cycles + 1 on a ras memory access: read latency = ras p recharge cycles + ras to cas delay cycles + access cycles + 1 additional cycles are also inserted and add to the latency when the address pipeline is congested, these cycles must then also be taken into calculation. a switch from an external memory or i/ o read access to an immediately succeeding writes access inserts one additional bus cycle. extended dsp instructions: the instruction issue time is always 1 cycle. after the issue of an extended dsp instruction, execution of non - extended - dsp instructions p roceeds while the extended dsp instruction is executed in the multiply/accumulate unit (using separate resources). latency cycles are defined as the interval between instruction issue and the result being avail able in the register g15 or register pair g14 //g15. the latency cycles indicate as well the number of cycles available for instructions not using the result that can be inserted between the
3 - 14 chapter 3 extended dsp instruction and the first instruction using the result. when less than the number of latency cycle s are used by these instructions, the execution of the instruction using the result is delayed until the result is available in g15 or g14//g15. when an extended dsp instruction that uses the internal hardware multiplier (emul, ..., ehcmacd) succeeds an ex tended dsp instruction that also uses the internal hardware multiplier after less than latency - 1 cycles, the issue of the succeeding extended dsp instruction is delayed until latency - 1 cycles are finished. an extended dsp instruction succeeding the ehc sumd or ehcfftd instruction after less than the latency cycles for these two instructions is always delayed until the ehcsumd or ehcfftd instruction is finished. the latency cycles are as follows: emul instruction: when both operands are in the range of - 2 15 ..2 15 - 1: 1 cycle all other cases: 3 cycles emulu instruction: when both operands are in the range of 0..2 16 - 1: 2 cycles all other cases: 4 cycles emuls instruction: when both operands are in the range of - 2 15 ..2 15 - 1: 3 cycles all other cases: 4 cycles em ac instruction: when both operands are in the range of - 2 15 ..2 15 - 1: 2 cycles all other cases: 3 cycles emacd instruction: when both operands are in the range of - 2 15 ..2 15 - 1: 3 cycles all other cases: 4 cycles emsub instruction: when both operands are in th e range of - 2 15 ..2 15 - 1: 2 cycles all other cases: 3 cycles emsubd instruction: when both operands are in the range of - 2 15 ..2 15 - 1: 3 cycles all other cases: 4 cycles ehmac instruction: 2 cycles ehmacd instruction: 4 cycles ehcmuld instruction: 4 cycles ehc macd instruction: 4 cycles ehcsumd instruction: 2 cycles ehcfftd instruction: 2 cycles
instruction set 3 - 1 3 . instruction set 3 . 1 memory instructions the memory instructions load data from memory in a register rs (or a register pair rs//rsf) or store data from rs (or rs//rsf) to memory using the data types byte unsigned/signed, half - word unsigned/sign ed, word or double - word. since i/o devices are also addressed by memory instructions, "memory" stands here interchangeably also for i/o unless memory or i/o address space is specifically denoted. the memory address is either specified by the operand rd or ld, by the sum rd plus a signed displacement or by the displacement alone, depending on the address mode. memory accesses to words and double - words ignore bits one and zero of the address, memory accesses to half - words ignore bit zero of the address, (sinc e these operands are located at word or half - word boundaries respectively, these address bits are redundant). if the content of any register rd except sr is zero, the memory is not accessed and a trap to pointer error occurs (see section 6. exceptions ). th us, uninitialized pointers are automatically checked. load and store instructions are pipelined to a total depth of two word entries for load and store, thus, a double - word load or a double - word store instruction can be executed without halting the process or in a wait state. (the address pipeline provides a depth of two addresses common to load and store). double - word memory instructions enter two separate word entries into the pipeline and start two independent memory cycles. the first memory cycle, loadin g or storing the high - order word, uses the address specified by the address mode, the second cycle uses this address incremented by four and also places it on the address bus. accessing data in the same dram memory page by any number of succeeding memory c ycles is performed in page mode. memory instructions leave all condition flags unchanged.
3 - 2 chapter 3 3 . 1 . 1 address modes register address mode: notation: ldxx. r , stxx. r -- xx: word or double word data type the content of the destination register ld is used as an address into memory address space. memory addr addr data data ld rs ldxx.r ld, rs memory addr addr data data ld rs stxx.r ld, rs postincrement address mode: notation: ldxx. p , stxx. p -- xx: word or double - word data type the content of the destination register ld is used as an address into memory address space, then ld is incremented according to the specified data size of a word or double - word memory instruction by 4 or 8 respectively, regardless of any exception occurring. in the case of a double - word data type, ld is incremented by 8 at the first memory cycle. memory addr addr data data ld rs ldxx.p ld, rs addr + size size= 4(word) or 8(double word) memory addr addr data data ld rs stxx.p ld, rs addr + size size= 4(word) or 8(double word) displacement address mode: notation: ldxx. d , stxx. d -- xx: any data type the sum of the contents of the destination register rd plus a signed displacement dis is used as an address into memory address space. memory addr addr data data rd rs ldxx.d rd, rs, dis addr + dis memory addr addr data data rd rs stxx.d rd, rs, dis addr + dis rd m ay denote any register except the sr; rd not denoting the sr differentiates this mode from the absolute address mode.
instruction set 3 - 3 in the case of all data types except byte, bit zero of dis is treated as zero for the calculation of rd + dis. note: specification of the pc for rd provides addressing relative to the address of the first byte after the memory instruction. absolute address mode: notation: ldxx. a , stxx. a -- xx: any data type the displacement dis is used as an address into memory address space. rd must denote the sr to differentiate this mode from the displacement address mode; the content of the sr is not used. memory dis data data rs ldxx.a 0, rs, dis stxx.a 0, rs, dis memory dis data data rs in the case of all data types except byte, address bit zero is supplied as zero. note: the displacement provides absolute addressing at the beginning and the end (mem3 area) of the memory. i/o displacement address mode: notation: ldxx. iod , stxx. iod -- xx: word or double - word data type the sum of the contents of the destination register rd plus a signed displacement dis is used as an addr ess into i/o address space. io addr addr data data rd rs ldxx.iod rd, rs, dis addr + dis io addr addr data data rd rs stxx.iod rd, rs, dis addr + dis rd may denote any register except the sr; rd not denoting the sr differentiates this mode from the i/o absolute address mode. bits one and zero of dis are treated as zero for the calculation of rd + dis.
3 - 4 chapter 3 execution of a memo ry instruction with i/o displacement address mode does not dis rupt any page mode sequence. note: the i/o displacement address mode provides dynamic addressing of peripheral devices. when on a load instruction only a byte or half - word is placed on the (low er part) of the data bus, the higher - order bits are undefined and must be masked out before the loaded operand is used further. i/o absolute address mode: notation: ldxx. ioa , stxx. ioa -- xx: word or double - word data type the displacement dis is used a s an address into i/o address space. io dis data data rs ldxx.ioa 0, rs, dis stxx.ioa 0, rs, dis io dis data data rs rd must denote the sr to differentiate this mode from the i/o displacement address mode; the content of the sr is not used. address bits one and zero are supplied as zero. execution of a memory instruction with i/o address mode does not disrupt any page mode sequence. note: the i/o absolute address mode provides code efficient absolute addressing of peripheral devices and allows simple decoding of i/o addresses. when on a load instruction only a byte or a half - word i s placed on the (lower part) of the data bus, the higher - order bits are undefined and must be masked out before the loaded operand is used further.
instruction set 3 - 5 next address mode: notation: ldxx. n , stxx. n -- xx: any data type the content of the destination reg ister rd is used as an address into memory address space, then rd is incremented by the signed displacement dis regardless of any excep tion occurring. at a double - word data type, rd is incremented at the first memory cycle. memory addr addr data data rd rs ldxx.n rd, rs, dis addr + dis memory addr addr data data rd rs stxx.n rd, rs, dis addr + dis rd must not denote the pc o r the sr. in the case of all data types except byte, bit zero of dis is treated as zero for the calculation of rd + dis. stack address mode: notation: ldw. s , stw. s -- only word data type the content of the destination register rd is used as stack address, then rd is in cremented by dis regardless of any exception occurred. stack addr addr data data rd rs ldxx.s rd, rs, dis addr + dis stack addr addr data data rd rs stxx.s rd, rs, dis addr + dis a stack address addresses memory address space if it is lower than the stack pointer sp; otherwise bits 7..2 of it (higher bits are ignored) address a register in the regist er part of the stack absolutely (not relative to the frame pointer fp). bits one and zero of dis are treated as zero for the calculation of rd + dis. rd must not denote the pc or the sr. note: the stack address mode must be used to address an operand in th e stack re gardless of its present location either in the memory part or in the register part of the stack. rd may be set by the set stack address instruction.
3 - 6 chapter 3 address mode encoding: the encoding of the displacement and absolute address mode types of mem ory instruc tions is shown in table 3 . 1 : ldxx.d/a/iod/ioa stxx.d/a/iod/ioa d - code dis(1) dis(0) rd does not denote sr rd denotes sr rd does not denote sr rd denotes sr 0 x x ldbs.d ldbs.a stbs.d stbs.a 1 x x ldbu.d ldbu.a stbu.d stbu.a 2 x 0 ldhu.d ldhu.a sthu.d sthu.a 2 x 1 ldhs.d ldhs.a sths.d sths.a 3 0 0 ldw.d ldw.a stw.d stw.a 3 0 1 ldd.d ldd.a std.d std.a 3 1 0 ldw.iod ldw.ioa stw.iod stw.ioa 3 1 1 ldd.iod ldd.ioa std.iod std.ioa table 3 . 1 : encoding of displacement and absolute address mode the encoding of the next and stack address mode types of memory instructions is shown in table 3 . 2 : with the instructions below, rd must not denote the pc or the sr d - code dis(1) dis(0) ldxx.n/s stxx.n/s 0 x x ldbs.n stbs.n 1 x x ldbu.n stbu.n 2 x 0 ldhu.n sthu.n 2 x 1 ldhs.n sths.n 3 0 0 ldw.n stw.n 3 0 1 ldd.n std.n 3 1 0 reserved reserved 3 1 1 ldw.s stw.s table 3 . 2 : enc oding of next and stack address mode
instruction set 3 - 7 3 . 1 . 2 load instructions the load instructions transfer data from the addressed memory location into a regi ster rs or a register pair rs//rsf. in the case of data types word and double - word, one or two words are read from memory and transferred unchanged into rs or rs//rsf respectively. in the case of byte and half - word data types, up to one word (depending on bus size) is read from memory, the byte or half - word addressed by bits one and zero or bit one of the memory address respectively is extracted, right adjusted, expanded to 32 bits and placed in rs. unsigned bytes and half - words are expanded by leading zeros; signed bytes and half - words are expanded by leading sign bits. execution of a load instruction enters the register address of rs, memory address bits one and zero and a code for the data type into the load pipeline, places the memory address onto the address bus and starts a memory cycle. a double - word load instructio n enters the register address of rsf and the same control information into the load pipeline as a second entry, places the memory address incremented by four onto the address bus and starts a second memory cycle. after execution of a load instruction, the next instructions are executed without wai ting for the data to be loaded. a wait is enforced only if an instruction uses a regi ster whose register address is still in the load pipeline. the data read from memory is placed in the register whose register a ddress is at the head of the load pipeline, its pipeline entry is then deleted. at memory load instruction rs denotes the load destination register to load data from memory, io or stack and rd denotes the load source register. rs must not denote the pc, th e sr, g14 or g15; these registers cannot be loaded from memory. format notation operation data type xx lr ldxx.r ld, rs rs := ld^; w,d [rsf := (ld + 4)^;] -- register address mode lr ldxx.p ld, rs rs := ld^; ld := ld + size; -- size = 4 or 8 w,d [rsf := (old ld + 4)^;] -- postincrement address mode rrdis ldxx.d rd, rs, dis rs := (rd + dis)^; bu,bs,hu,hs,w,d [rsf := (rd + dis + 4)^;] -- displacement address mode rrdis ldxx.a 0, rs, dis rs := dis^; bu,bs,hu,hs,w,d [rsf := (dis + 4) ^;] -- absolute address mode rrdis ldxx.iod rd, rs, dis rs := (rd + dis)^; w,d [rsf := (rd + dis + 4)^;] -- i/o displacement address mode rrdis ldxx.ioa 0, rs, dis rs := dis^; w,d [rsf := (dis + 4)^;] -- i/o absolute address mode
3 - 8 chapter 3 rrdis ldxx. n rd, rs, dis rs := rd^; rd := rd + dis; bu,bs,hu,hs,w,d [rsf := (old rd + 4)^;] -- next address mode rrdis ldxx.s rd, rs, dis rs := rd^; rd := rd + dis; w -- stack address mode the expressions in brackets are only executed at double - word data ty pes. data type xx is with: bu: byte unsigned; hu: half - word unsigned; w: word; bs: byte signed; hs: half - word signed; d: double - word; register l0 : $00001e30 l6 : $0000ffff l7 : $ffff0000 memory 00001e30 : 00000f00 00001e34 : 0 0003f01 00001e38 : 00004c10 00001e3c : 000000ff instruction : register address mode ldw.r l0, l6 ; l6 <= l0^ = address 00001e30 : $00000f00 ldd.r l0, l6 ; l6 <= l0^ = address 00001e30 : $00000f00 ; l7 <= (l0 + 4)^ = address 00001e 34 : $00003f01 instruction : displacement address mode ldw.d l0, l6, $8 ; l6 = (l0 + 8)^ = address 00001e38 : $00004c10 ldd.d l0, l6, $8 ; l6 = (l0 + 8)^ = address 00001e38 : $00004c10 ; l7 = (l0 + 8 + 4)^ = address 00001e3c : $000000ff
instruction set 3 - 9 3 . 1 . 3 store instructions the store instructions transfer data from the register rs or the register pair rs//rsf to the addressed memory location. in the case of data types word or double - word, one or two words are placed unchanged from rs or rs//rsf respectively onto the data bus to be stored in the memory. in the case of byte and half - word data types, the low - order byte or half - word is placed onto the data bus at the byte or half - word position addressed by bits one and zero or bit one of the memory address respectively; it is implied to be merged (via byte write enable) with the other data in the same memory word. in the case of signed byte and signed half - word data types, any con tent of rs exceeding the value rang e of the specified data type causes a trap to range error. the byte or half - word is stored regardless of a range error. if rs denotes the sr, zero is stored regardless of the content of sr (or of sr//g2 at double - word). execution of a store instruction ent ers the contents of rs, memory address bits one and zero and a code for the data type into the store pipeline, places the memory ad dress onto the address bus and starts a memory cycle. a double - word store instruc tion enters the contents of rsf and the sa me control information into the store pipe line as a second entry, places the memory address incremented by four onto the ad dress bus and starts a second memory cycle. after execution of a store instruction, the next instructions are executed without wait ing for the store memory cycle to finish. the data at the head of the store pipeline is put on the data bus on demand from the on - chip memory control logic and its pipeline entry is deleted. when rsf denotes the same register as rd (or ld) at double - word i nstructions with next address or postincrement address mode, the incremented content of rsf is stored in the second memory cycle; in all other cases, the unchanged content of rs or rsf is stored. format notation operation data type xx lr stxx.r ld, rs ld ^ := rs; w,d [(ld + 4)^ := rsf;] -- register address mode lr stxx.p ld, rs ld^ := rs; ld := ld + size; -- size = 4 or 8 w,d [(old ld + 4)^ := rsf;] -- postincrement address mode rrdis stxx.d rd, rs, dis (rd + dis)^ := rs; bu,bs,hu,hs,w,d [(rd + dis + 4)^ := rsf;] -- displacement address mode rrdis stxx.a 0, rs, dis dis^ := rs; bu,bs,hu,hs,w,d [(dis + 4)^ := rsf;] -- absolute address mode rrdis stxx.iod rd, rs, dis (rd + dis)^ := rs; w,d [(rd + dis + 4)^ := rsf;] -- i/o di splacement address mode
3 - 10 chapter 3 rrdis stxx.ioa 0, rs, dis dis^ := rs; w,d [(dis + 4)^ := rsf;] -- i/o absolute address mode rrdis stxx.n rd, rs, dis rd^ := rs; rd := rd + dis; bu,bs,hu,hs,w,d [(old rd + 4)^ := rsf;] -- next address mode rrdis stxx.s r d, rs, dis rd^ := rs; rd := rd + dis; w -- stack address mode the expressions in brackets are only executed at double - word data types. in the case of signed byte and half - word data types, a trap to range error occurs when the value of the operand to be stored exceeds the value range of the specified data type; the byte or half - word is stored regardless of a range error. data type xx is with: bu: byte unsigned; hu: half - word unsigned; w: word; bs: byte signed; hs: half - word signed; d: double - word; re gister l0 : $00001e30 l6 : $0000ffff l7 : $ffff0000 memory 00001e30 : 00000f00 00001e34 : 00003f01 00001e38 : 00004c10 00001e3c : 000000ff instruction : register address mode stw.r l0, l6 ; l0^ = l6 = address 00001e3 0 : $0000ffff std.r l0, l6 ; l0^ = l6 = address 00001e30 : $0000ffff ; (l0 + 4)^ = l7 = address 00001e34 : $ffff0000 instruction : displacement address mode stw.d l0, l6, $8 ; (l0 + 8)^ = l6 = address 00001e38 : $0000ffff std.d l0, l6, $ 8 ; (l0 + 8)^ = l6 = address 00001e38 : $0000ffff ; (l0 + 8 + 4)^ = l7 = address 00001e3c : $ffff0000
instruction set 3 - 11 3 . 2 move word instructions the source operand or the immediate operand is copied to the destination register and the condition flags are set or cleared accordingly. format notation operation rr mov rd, rs rd := rs; z := rd = 0; n := rd(31); v := undefined; rimm movi rd, imm rd := imm; z := rd = 0; n := rd(31); v := 0; 3 . 3 move double - word instruction the double - word source operand is copied to the double - word destination register pair and the condition flags are set or cleared accordingly. the high - order word in rs is copied first. when the sr is denoted as a source operand, the source operand is supplied as zero regardless of the content of sr//g2. when the pc is denoted as destination, the return instruction ret is executed instead of the move double - word instruction. format notation operation rr movd rd, rs if rd does not denote pc and rs does not denote sr then rd := rs; rdf := rsf; z := rd//rdf = 0; n := rd(31); v := undefined; rr movd rd, 0 if rd does not denote pc and rs denotes sr then rd := 0; rdf := 0; z := 1; n := 0; v := undefined; rr ret pc, rs if rd denotes pc then execute the ret instruction; register l0 : $xxxxxxxx l1 : $xxxxxxxx l6 : $0000ffff l7 : $ffff0000 instruction mov l0, l6 ; l0 = l6 = $0000ffff movi l0, $4 ; l0 = imm = $4 movd l0, l6 ; l0 = l6 = $0000ffff ; l1 = l7 = $ffff0000
3 - 12 chapter 3 3 . 4 logical instructions the result of a bitwise logical and, and not (andn), or or exclusive or (xor) of the source or immediat e operand and the destination operand is placed in the destina tion register and the z flag is set or cleared accordingly. at andn, the source ope rand is used inverted (itself remaining unchanged). all operands and the result are interpreted as bitstrings of 32 bits each. format notation operation rr and rd, rs rd := rd and rs; -- logical and z := rd = 0; rr andn rd, rs rd := rd and not rs; -- logical and with source z := rd = 0; used inverted rr or rd, rs rd := rd or rs; -- logical or z := rd = 0; rr xor rd, rs rd := rd xor rs; -- logical exclusive or z := rd = 0; rimm andni rd, imm rd := rd and not imm; -- logical and with imm z := rd = 0; used inverted rimm ori rd, imm rd := rd or imm; -- logical or z := rd = 0; rimm xori rd, imm rd := rd xor imm; -- logical exclusive or z := rd = 0; note: andn and andni are the instructions complementary to or and ori: where or and ori set bits, andn and andni clear bits at bit positions with a "one" bit in the source or immediate operand, thus obv iating the need for an inverted mask in most cases. register l0 : $0f0cffff l1 : $ffff0000 instruction and l0, l1 ; l0 = l0 and l1 = $0f0c0000 andn l0, l1 ; l0 = l0 and not l1 = $0000ffff or l0, l1 ; l0 = l0 or l1 = $ffffffff xor l0, l1 ; l0 = l0 xor l1 = $f0f3ffff andni l0, $1234 ; l0 = l0 and not imm = $0f0cedcb ori l0, $1234 ; l0 = l0 or imm = $0f0cffff xori l0, $1234 ; l0 = l0 xor imm = $0f0cedcb
instruction set 3 - 13 3 . 5 invert i nstruction the source operand is placed bitwise inverted in the destination register and the z flag is set or cleared accordingly. the source operand and the result are interpreted as bitstrings of 32 bits each. format notation operation rr not rd, rs rd := not rs; z := rd = 0; 3 . 6 mask instruction the result of a bitwise logical and of the source operand and the immediate operand is placed in the destination register and the z flag is set or cleared accord ingly. all operands and the result are interpreted as bitstrings of 32 bits each. format notation operation rrconst mask rd, rs, const rd := rs and const; z := rd = 0; note: the mask instruction may be used to move a source operand with bits partly mask ed out by an immediate operand used as mask. the immediate operand const is constrained in its range by bits 31 and 30 being either both zero or both one (see format rrconst). if these bits are required to be different, the instruction pair movi, and may b e used instead of mask.
3 - 14 chapter 3 3 . 7 add instructions the source operand, the source operand + c or the immediate operand is added to the destination operand, the result is placed in the destination register and the condi tion flags are set or cleared accordingly. at add, addc and addi, both operands and the result are interpreted as either all signed or all unsigned integers. at adds and addsi, both operands and the result are signed integers and a trap to range erro r occurs at overflow. format notation operation rr add rd, rs rd := rd + rs; -- signed or unsigned add z := rd = 0; n := rd(31); -- sign v := overflow; c := carry; rr adds rd, rs rd := rd + rs; -- signed add with trap z := rd = 0; n := rd(31) ; -- sign v := overflow; if overflow then trap t range error; rr addc rd, rs rd := rd + rs + c; -- signed or unsigned add z := z and (rd = 0); with carry n := rd(31); -- sign v := overflow; c := carry; when the sr is denoted as a source op erand at add, adds and addc, c is added instead of the sr. the notation is then: format notation operation rr add rd, c rd := rd + c; -- signed or unsigned add c rr adds rd, c rd := rd + c; -- signed add c with trap rr addc rd, c rd := rd + c; the flags and the trap condition are treated as defined by add, adds or addc.
instruction set 3 - 15 format notation operation rimm addi rd, imm rd := rd + imm; -- signed or unsigned add z := rd = 0; n := rd(31); -- sign v := overflow; c := carry; rimm addsi rd, imm rd := rd + imm; -- signed add with trap z := rd = 0; n := rd(31); -- sign v := overflow; if overflow then trap t range error; the following instructions are special cases of addi and addsi differentiated by n = 0 (see section 2.3.1. table of immediate val ues ): format notation operation rimm addi rd, cz rd := rd + (c and (z = 0 or rd(0))); -- round to even rimm addsi rd, cz rd := rd + (c and (z = 0 or rd(0))); -- round to even the flags and the trap condition are treated as defined by addi or addsi. note: at addc, z is cleared if rd 1 0, otherwise left unchanged; thus, z is evalua ted correctly for multi - precision operands. the effect of a subtract immediate instruction can be obtained by using the negated 32 - bit value of the immediate operand to be subtra cted (except zero). at unsigned, c = 0 indicates then a borrow (the unsigned number range is exceeded below zero). at "round to even", c is only added to the destination operand if z = 0 or rd(0) is one. the z flag is assumed to be set or cleared by a prec eding shift left instruction. "round to even" provides a better averaging of rounding errors than "add carry". "round to even" is equivalent to the "round to nearest" floating - point rounding mode and may be used to implement it efficiently. register l0 : $00000004 l1 : $fffffffc instruction add l0, l1 ; l0 = l0 + l1 = $0 addi l0, $120 ; l0 = l0 + imm = $124
3 - 16 chapter 3 3 . 8 sum instructions the sum of the source operand and the immediate operand is placed in the destina tion register and the condition flags are set or cleared accordingly. at sum, both operands and the result are interpreted as either all signed or all unsigned integers. at sums, both operands and the result are signed integers and a trap to range error occurs at overflow. format notation operation rrconst sum rd, rs, const rd := rs + const; -- signed or unsigned sum z := rd = 0; n := rd(31); -- sign v := overflow; c := carry; rrconst sums rd, rs, const rd := rs + const; - - signed sum with trap z := rd = 0; n := rd(31); -- sign v := overflow; if overflow then trap t range error; when the sr is denoted as a source operand at sum and sums, c is added instead of the sr. the notation is then: format notation operatio n rrconst sum rd, c, const rd := c + const; -- signed or unsigned sum c rrconst sums rd, c, const rd := c + const; -- signed sum c the flags are treated as defined by sum or sums. a trap cannot occur. note: the effect of a subtract immediate instruction can be obtained by using the negated 32 - bit value of the immediate operand to be subtracted (except zero). at unsigned, c = 0 indicates then a borrow (the unsigned number range is exceeded below zero). the immediate operand is constrained to the range of c onst. the instruction pair mov, addi or mov, addsi may be used where the full integer range is required. register l0 : $fffffffc l1 : $00000004 instruction sum l0, l1, $120 ; l0 = l1 + const = $124
instruction set 3 - 17 3 . 9 subtract instructions the source operand or the source operand + c is subtracted from the destination ope rand, the result is placed in the destination register and the condition flags are set or cleared accordingly. at sub and subc, both o perands and the result are interpreted as either all signed or all unsigned integers. at subs, both operands and the result are signed integers and a trap to range error occurs at overflow. format notation operation rr sub rd, rs rd := rd - rs; -- signed or unsigned subtract z := rd = 0; n := rd(31); -- sign v := overflow; c := borrow; rr subs rd, rs rd := rd - rs; -- signed subtract with trap z := rd = 0; n := rd(31); -- sign v := overflow; if overflow then trap t range error; rr subc rd, rs rd := rd - (rs + c); -- signed or unsigned subtract z := z and (rd = 0); with borrow n := rd(31); -- sign v := overflow; c := borrow; when the sr is denoted as a source operand at sub, subs and subc, c is subtrac ted instead of the sr. the notation is then: format notation operation rr sub rd, c rd := rd - c; -- signed or unsigned subtract c rr subs rd, c rd := rd - c; -- signed subtract c with trap rr subc rd, c rd := rd - c; the flags and the trap condition are treated as defined by su b, subs or subc. note: at subc, z is cleared if rd 1 0, otherwise left unchanged; thus, z is evalua ted correctly for multi - precision operands. register l0 : $124 l1 : $4 instruction sub l0, l1 ; l0 = l0 - l1 = $120
3 - 18 chapter 3 3 . 10 negate instructions the source operand is subtracted from zero, the result is placed in the destination register and the condition flags are set or cleared accordingly. at neg and negs, the source operand and the result ar e interpreted as either both signed or both unsigned integers. at negs, the source operand and the result are signed integers and a trap to range error occurs at overflow. format notation operation rr neg rd, rs rd := - rs; -- signed or unsigned negate z := rd = 0; n := rd(31); -- sign v := overflow; c := borrow; rr negs rd, rs rd := - rs; -- signed negate with trap z := rd = 0; n := rd(31); -- sign v := overflow; if overflow then trap t range error; when the sr is denoted as a source o perand at neg and negs, c is negated instead of the sr. the notation is then: format notation operation rr neg rd, c rd := - c; -- signed or unsigned negate c if c is set then rd := - 1; else rd := 0; rr negs rd, c rd := - c; -- sign ed negate c if c is set then rd := - 1; else rd := 0; the flags are treated as defined by neg or negs. a trap cannot occur. register l0 : $124 l1 : $4 instruction neg l0, l1 ; l0 = - l1 = $fffffffc 3 . 11 multiply word instruction the source operand and the destination operand are multiplied, the low - order word of the
instruction set 3 - 19 product is placed in the destination register (the high - order product word is not evaluated) and the con dition flags are set or cleared according to the single - word product. both operands are either signed or unsigned integers, the product is a single - word integer. note that the low - order word of the product is identical regardless of whether the operands ar e signed or unsigned. the result is undefined if the pc or the sr is denoted. format notation operation rr mul rd, rs rd := low order word of product rd * rs; z := singleword product = 0; n := rd(31); -- sign of singleword product; -- valid for signed operands; v := undefined; c := undefined; 3 . 12 multiply double - word instructions the source operand and the destination operand are multiplied, the double - word pro duct is placed in the destination register pair (the destination register expanded by the register following it) and the condition flags are set or cleared according to the double - word product. at muls, both operands are signed integers and the product is a signed double - word integer. at mulu, both operands are unsigned integers and the product is an unsigned double - word integer. the result is undefined if the pc or the sr is denoted. format notation operation rr muls rd, rs rd//rdf := signed doubleword product of rd * rs; z := rd//rdf = 0; -- doubleword product is zero n := rd(31); -- doubleword product is negative v := undefined; c := undefined; rr mulu rd, rs rd//rdf := unsigned doubleword product of rd * rs; z := rd//rdf = 0; -- doubleword product is zero n := rd( 31); v := undefined; c := undefined;
3 - 20 chapter 3 register l0 : $5678 l1 : $1234 l2 : $9abc instruction mul l0, l2 ; l0 = $3443b020 mulu l0, l2 ; l0 = $0 ; l1 = $3443b020 3 . 13 divide in structions the double - word destination operand (dividend) is divided by the single - word source operand (divisor), the quotient is placed in the low - order destination register (rdf), the remainder is placed in the high - order destination register (rd) and th e condition flags are set or cleared according to the quotient. a trap to range error occurs if the divisor is zero or the value of the quotient ex ceeds the integer value range (quotient overflow). the result (in rd//rdf) is then un defined. at divs, a tr ap to range error also occurs and the result is undefined if the dividend is negative. at divs, the dividend is a non - negative signed double - word integer, the divisor, the quotient and the remainder are signed integers; a non - zero remainder has the sign of the dividend. at divu, the dividend is an unsigned double - word integer, the divisor, the quotient and the remainder are unsigned integers. the result is undefined if rs denotes the same register as rd or rdf or if the pc or the sr is denoted.
instruction set 3 - 21 format nota tion operation rr divs rd, rs if rs = 0 or quotient overflow or rd(31) = 1 then -- dividend is negative rd//rdf := undefined; z := undefined; n := undefined; v := 1; trap t range error; else remainder rd, quotient rdf := (rd//rdf) / rs; z := rdf = 0; -- quotient is zero n := rdf(31); -- quotient is negative v := 0; rr divu rd, rs if rs = 0 or quotient overflow then rd//rdf := undefined; z := undefined; n := undefined; v := 1; trap t range error; else rem ainder rd, quotient rdf := (rd//rdf) / rs; z := rdf = 0; -- quotient is zero n := rdf(31); v := 0; register l0 : $1 l1 : $23456789 l2 : 123456 instruction divu l0, l2 ; l0 = $789 ; l1 = $1000
3 - 22 chapter 3 3 . 14 shift left instructions the destination operand is shifted left by a number of bit positions specified at shli, shldi by n = 0..31 as a shift by 0..31; at shl, shld by bits 4..0 of the source operand as a shift by 0..31. the high er - order bits of the source operand are ignored. the destination operand is interpreted at shl and shli as a bitstring of 32 bits or as a signed or unsigned integer; at shld and shldi as a double - word bitstring of 64 bits or as a signed or unsigned double - word integer. all shift left instructions insert zeros in the vacated bit positions at the right. the double - word shift left instructions execute in two cycles. the low - order operand in ldf is shifted first. at shld, the result is undefined if ls denotes t he same regi ster as ld or ldf. format notation operation insert rn shli rd, n rd := rd << by n; -- 0..31 zeros ln shldi ld, n ld//ldf := ld//ldf << by n; -- 0..31 zeros ll shl ld, ls ld := ld << by ls(4..0); -- 0..31 zeros ll shld ld, ls ld//ldf := l d//ldf << by ls(4..0); -- 0..31 zeros the condition flags are set or cleared by all shift left instructions as follows: z := ld = 0 or rd = 0 on single - word; z := ld//ldf = 0 on double - word; n := ld(31) or rd(31); v := undefined c := undefined; note: the symbol < < signifies "shifted left". register l0 : $ffff l1 : $2 instruction shli l0, $4 ; l0 = $000ffff0 shl l0, l1 ; l0 = $0003fffc
instruction set 3 - 23 3 . 15 shift right instructions the destination operand is shifted right by a number of bit positions specified at sari, sardi, shri, shrdi by n = 0..31 as a shift by 0..31. at sar, sard, shr, shrd by bits 4..0 of the source operand as a shift by 0..31. the higher - order bits of the source operand are ig nored. the destination operand is interpreted at sar and sari as a signed integer; at sard and sardi as a signed double - word integer; at shr and shri as a bitstring of 32 bits or as an unsigned integer; at shrd and shrdi as a double - word bitstring of 64 bi ts or as an unsigned double - word integer. all shift right instructions that interpret the destination operand as signed insert sign bits, all others insert zeros in the vacated bit positions at the left. the double - word shift right instructions execute in two cycles. the high - order ope rand in ld is shifted first. at sard and shrd, the result is undefined if ls denotes the same register as ld or ldf. format notation operation insert rn sari rd, n rd := rd >> by n; -- 0..31 sign bits ln sardi ld, n ld//ld f := ld//ldf >> by n; -- 0..31 sign bits ll sar ld, ls ld := ld >> by ls(4..0); -- 0..31 sign bits ll sard ld, ls ld//ldf := ld//ldf >> by ls(4..0); -- 0..31 sign bits rn shri rd, n rd := rd >> by n; -- 0..31 zeros ln shrdi ld, n ld//ldf := ld//ldf >> by n; -- 0..31 zeros ll shr ld, ls ld := ld >> by ls(4..0); -- 0..31 zeros ll shrd ld, ls ld//ldf := ld//ldf >> by ls(4..0); -- 0..31 zeros the condition flags are set or cleared by all shift right instructions as follows: z := ld = 0 or rd = 0 on singl e - word; z := ld//ldf = 0 on double - word; n := ld(31) or rd(31); c := last bit shifted out is "one"; note: the symbol > > signifies "shifted right".
3 - 24 chapter 3 register l0 : $c000ffff l1 : $2 instruction sari l0, $4 ; l0 = $fc000fff sal l0, l1 ; l0 = $f0003fff shri l0, $4 ; l0 = $0c000fff shl l0, l1 ; l0 = $30003fff 3 . 16 rotate left instruction the destination operand is shifted left by a number of bit positions and the bits shif ted o ut are inserted in the vacated bit positions; thus, the destination operand is ro tated. the condition flags are set or cleared accordingly. bits 4..0 of the source ope rand specify a rotation by 0..31 bit positions; bits 31..5 of the source operand are ig nored. the destination operand is interpreted as a bitstring of 32 bits. format notation operation ll rol ld, ls ld := ld rotated left by ls(4..0); z := ld = 0; n := ld(31); v := undefined; c := undefined; note: the condition flags are set or clea red by the same rules applying to the shift left instructions. register l0 : $c000ffff l1 : $4 instruction rol l0, l1 ; l0 = $000ffffc
instruction set 3 - 25 3 . 17 index move instructions the source operand is pla ced shifted left by 0, 1, 2 or 3 bit positions in the destina tion register, corresponding to a multiplication by 1, 2, 4 or 8. at xm1..xm4, a trap to range error occurs if the source operand is higher than the immediate operand lim (upper bound). all cond ition flags remain unchanged. all operands and the result are interpreted as unsigned integers. the sr must not be denoted as a source nor as a destination, nor the pc as a destina tion operand; these notations are reserved for future expansion. when the p c is deno ted as a source operand, a trap to range error occurs if pc 3 lim. x - code format notation operation 0 rrlim xm1 rd, rs, lim rd := rs * 1; if rs > lim then trap t range error; 1 rrlim xm2 rd, rs, lim rd := rs * 2; if rs > lim the n trap t range error; 2 rrlim xm4 rd, rs, lim rd := rs * 4; if rs > lim then trap t range error; 3 rrlim xm8 rd, rs, lim rd := rs * 8; if rs > lim then trap t range error; 4 rrlim xx1 rd, rs, 0 rd := rs * 1; -- move without fla g change 5 rrlim xx2 rd, rs, 0 rd := rs * 2; 6 rrlim xx4 rd, rs, 0 rd := rs * 4; 7 rrlim xx8 rd, rs, 0 rd := rs * 8; note: the index move instructions move an index value scaled (multiplied by 1, 2, 4 or 8). xm1..xm4 check also the unscaled value for an upper bound, optionally also excluding zero. if the lower bound is not zero or one, it may be mapped to zero by subtracting it from the index value before applying an index move instruction. register l0 : $456 l1 : $123 instruction xm2 l0, l1, 124 ; l0 = $246 xm2 l0, l1, 122 ; integer range error in task at address xxxxxxxx xx2 l0, l1, 0 ; l0 = $246
3 - 26 chapter 3 3 . 18 check instructions the destination operand is checked and a trap to range err or occurs at chk if the destination operand is higher than the source operand, at chkz if the destination operand is zero. all registers and all condition flags remain unchanged. all operands are interpreted as unsigned integers. chkz shares its basic op - c ode with chk, it is differentiated by denoting the sr as source operand. format notation operation rr chk rd, rs if rs does not denote sr and rd > rs then trap t range error; rr chkz rd, 0 if rs denotes sr and rd = 0 then trap t range error; when r s denotes the pc, chk traps if rd 3 pc. thus, chk, pc, pc always traps. since chk, pc, pc is encoded as 16 zeros, an erroneous jump into a string of zeros causes a trap to range error, thus trapping some address errors. note: chk checks the upper bound of an unsigned value range, implying a lower bound of zero. if the lower bound is not zero, it can be mapped to zero by subtrac ting it from the value to be checked and then checking against a corrected upper bound (lower bound also subtracted). when the uppe r bound is a constant not excee ding the range of lim, the index instructions may be used for bounds checks. chkz may be used to trap on uninitialized pointers with the value zero. 3 . 19 no operation instructi on the instruction chk, l0, l0 cannot cause any trap. since chk leaves all registers and condition flags unchanged, it can be used as a no operation instruction with the notation: format notation operation rr nop no operation; note: the nop instruction may be used as a fill instruction.
instruction set 3 - 27 3 . 20 compare instructions two operands are compared by subtracting the source operand or the immediate ope rand from the destination operand. the condition flags are set or cl eared according to the result; the result itself is not retained. note that the n flag indicates the correct compare result even in the case of an overflow. all operands and the result are interpreted as either all signed or all unsigned inte gers. format notation operation rr cmp rd, rs result := rd - rs; z := rd = rs; -- result is zero n := rd < rs signed; -- result is true negative v := overflow; c := rd < rs unsigned; -- borrow rimm cmpi rd, imm result := rd - imm; z := rd = imm; -- result i s zero n := rd < imm signed; -- result is true negative v := overflow; c := rd < imm unsigned; -- borrow when the sr is denoted as a source operand at cmp, c is subtracted instead of sr. the notation is then: format notation operation rr cmp, rd, c r esult := rd - c; z := rd = c; -- result is zero n := rd < c signed; -- result is true negative v := overflow; c := rd < c unsigned; -- borrow 3 . 21 compare bit instructions the result of a bitwise logi cal and of the source or immediate operand and the destination operand is used to set or clear the z flag accordingly; the result itself is not retained. all operands and the result are interpreted as bitstrings of 32 bits each. format notation operation r r cmpb rd, rs z := (rd and rs) = 0; rimm cmpbi rd, imm z := (rd and imm) = 0; the following instruction is a special case of cmpbi differentiated by n = 0 (see section 4.3.1. table of immediate values ): format notation operation rimm cmpbi rd, anybz z : = rd(31..24) = 0 or rd(23..16) = 0 or rd(15..8) = 0 or rd(7..0) = 0; -- any byte of rd = 0
3 - 28 chapter 3 3 . 22 test leading zeros instruction the number of leading zeros in the source operand is tested and placed in the desti nation register. a source operand equal to zero yields 32 as a result. all condition flags remain unchanged. format notation operation ll testlz ld, ls ld := number of leading zeros in ls; 3 . 23 se t stack address instruction the frame pointer fp is placed, expanded to the stack address, in the destination re gister. the fp itself and all condition flags remain unchanged. the expanded fp ad dress is the address at which the content of l0 would be sto red if pushed onto the memory part of the stack. the set stack address instruction shares the basic op - code setxx, it is differentiated by n = 0 and not denoting the sr or the pc. n format notation operation 0 rn setadr rd rd := sp(31..9)//sr(31..25)//00 + carry into bit 9 -- sr(31..25) is fp -- carry into bit 9 := (sp(8) = 1 and sr(31) = 0) note: the set stack address instruction calculates the stack address of the beginning of the current stack frame. l0..l15 of this frame can then be addressed r elative to this stack address in the stack address mode with displacement values of 0..60 respectively. provided the stack address of a stack frame has been saved, for example in a global register, any data in this stack frame can then be addressed also fr om within all younger generations of stack frames by using the saved stack address. (addressing of local variables in older generations of stack frames is required by all block oriented programming languages like pascal, modula - 2 and ada.) the basic op - cod e setxx is shared as indicated: n = 0 while not denoting the sr or the pc differentiates the set stack address instruction. n = 1..31 while not denoting the sr or the pc differentiate the set conditional instructions. denoting the sr differentiates t he fetch instruction. denoting the pc is reserved for future use. 3 . 24 set conditional instructions the destination register is set or cleared according to the states of the condition flags specified by n. the condition flags themselves remain unchanged. the set conditional instructions share the basic op - code setxx, they are differen tiated by n = 1..31 and not denoting the sr or the pc.
instruction set 3 - 29 format is rn n notation or alternative operation 1 reserved 2 set1 rd rd := 1; 3 set0 rd rd := 0; 4 setle rd if n = 1 or z = 1 then rd := 1 else rd := 0; 5 setgt rd if n = 0 and z = 0 then rd := 1 else rd := 0; 6 setlt rd setn rd if n = 1 then rd := 1 else rd := 0; 7 setge rd setnn rd if n = 0 then rd := 1 else rd := 0; 8 setse rd if c = 1 or z = 1 then rd := 1 else rd := 0; 9 setht rd if c = 0 and z = 0 then rd := 1 else rd := 0; 10 setst rd setc rd if c = 1 then rd := 1 else rd := 0; 11 sethe rd setnc rd if c = 0 then rd := 1 else rd := 0; 1 2 sete setz if z = 1 then rd := 1 else rd := 0; 13 setne setnz if z = 0 then rd := 1 else rd := 0; 14 setv rd if v = 1 then rd := 1 else rd := 0; 15 setnv rd if v = 0 then rd := 1 else rd := 0; 16 reserved 17 reserved 18 set1m rd rd := - 1; 19 reserved 20 setlem rd if n = 1 or z = 1 then rd := - 1 else rd := 0; 21 setgtm rd if n = 0 and z = 0 then rd := - 1 else rd := 0; 22 setltm rd setnm rd if n = 1 then rd := - 1 else rd := 0; 23 setgem rd setnnm rd if n = 0 then rd := - 1 else rd := 0; 24 setsem rd if c = 1 or z = 1 then rd := - 1 else rd := 0; 25 sethtm rd if c = 0 and z = 0 then rd := - 1 else rd := 0; 26 setstm rd setcm rd if c = 1 then rd := - 1 else rd := 0; 27 sethem rd setncm rd if c = 0 then rd := - 1 else rd := 0; 28 setem setzm if z = 1 then rd := - 1 else rd := 0; 29 setnem setnzm if z = 0 then rd := - 1 else rd := 0; 30 setvm rd if v = 1 then rd := - 1 else rd := 0; 31 setnvm rd if v = 0 then rd := - 1 else rd := 0;
3 - 30 chapter 3 3 . 25 branch instructions the branch instruction br, and any of the conditional branch instructions when the branch condition is met, place the branch address pc + rel (relative to the address of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution pro ceeds at the branch address placed in the pc. when the branch condition is not met, the m flag and the condition flags remain un - changed and i nstruction execution proceeds sequentially. besides these explicit branch instructions, the instructions mov, movi, add, addi, sum, sub may denote the pc as a destination register and thus be executed as an implicit branch; the m flag is cleared and the co ndition flags are set or cleared ac cording to the specified instruction. all other instructions, except compare instructions, must not be used with the pc as destination, otherwise possible range errors caused by these instructions would lead to ambiguous results on backtracking. format is pcrel notation or alternative operation comment ble rel if n = 1 or z = 1 then br; -- l ess or e qual signed bgt rel if n = 0 and z = 0 then br; -- g reater t han signed blt rel bn rel if n = 1 then br; -- l ess t han signed bge rel bnn rel if n = 0 then br; -- g reater or e qual signed bse rel if c = 1 or z = 1 then br; -- s maller or e qual unsigned bht rel if c = 0 and z = 0 then br; -- h igher t han unsigned bst rel bc rel if c = 1 then br; -- s maller t han unsign ed bhe rel bnc rel if c = 0 then br; -- h igher or e qual unsigned be rel bz rel if z = 1 then br; -- e qual bne rel bnz rel if z = 0 then br; -- n ot e qual bv rel if v = 1 then br; -- o v erflow bnv rel if v = 0 then br; -- n ot o v erflow br rel pc := pc + rel; m := 0; note: rel is signed to allow forward or backward branches. instruction loop1: movi l0, $1234 ble loop1 ; if n=1 or z=1 then branch bne loop1 ; if z=0 then branch
instruction set 3 - 31 3 . 26 delayed bran ch instructions the delayed branch instruction dbr, and any of the conditional delayed branch in - structions when the branch condition is met, place the branch address pc + rel (rela tive to the address of the first byte after the delayed branch instruction ) in the pro gram counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not take n. when the delayed branch is not taken, the delay instruction is executed like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is ex ecuted before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. in the case of an error exception caused by a delay instruction succeeding a delayed branch taken, the location of the saved return pc contains the address of the first byte of the delay instruction. the saved ilc contains the length (1 or 2 half - words) of the delaye d branch instruction. in the case of all other excep tions following a delay instruction succeeding a delayed branch taken, the location of the saved return pc contains the branch target address of the delayed branch and the saved ilc is invalid. the follo wing restrictions apply to delay instructions: the sum of the length of the delayed branch instruction and the delay instruction must not exceed three half - words, otherwise an arbitrary bit pattern may be supplied and erroneously used for the second or thi rd half - word of the delay instruction without any warning. the delayed branch instruction and the delay instruction are locked against any ex ception except reset. a fetch or any branching instruction must not be placed as a delay instruction. a misplaced delayed branch instruction would be executed like the corresponding non - delayed branch instruction to inhibit a permanent exception lock - out. format is pcrel
3 - 32 chapter 3 notation or alternative operation comment dble rel if n = 1 or z = 1 then dbr; -- l ess or e qua l signed dbgt rel if n = 0 and z = 0 then dbr; -- g reater t han signed dblt rel dbn rel if n = 1 then dbr; -- l ess t han signed dbge rel dbnn rel if n = 0 then dbr; -- g reater or e qual signed dbse rel if c = 1 or z = 1 then dbr; -- s maller or e qual u nsigned dbht rel if c = 0 and z = 0 then dbr; -- h igher t han unsigned dbst rel dbc rel if c = 1 then dbr; -- s maller t han unsigned dbhe rel dbnc rel if c = 0 then dbr; -- h igher or e qual unsigned dbe rel dbz rel if z = 1 then dbr; -- e qual dbne re l dbnz rel if z = 0 then dbr; -- n ot e qual dbv rel if v = 1 then dbr; -- o v erflow dbnv rel if v = 0 then dbr; -- n ot o v erflow dbr rel pc := pc + rel; note: rel is signed to allow forward or backward branches. attention: since the pc seen by the dela y instruction depends on the delayed branch taken or not taken, a delay instruction after a conditional delayed branch instruction must not reference the pc. instruction loop1: movi l0, $1234 dble loop1 ; if n=1 or z=1 then delay branch addi l0, $10 ; => if n=1 or z=1 ; then l0 = l0 + $10, branch to loop1 dbne loop1 ; if z=0 then delay branch addi l0, $10 ; => if n=1 or z=1 ; then l0 = l0 + $10, branch to loop1
instruction set 3 - 33 3 . 27 c all instruction the call instruction causes a branch to a subprogram. the branch address rs + const, or const alone if rs denotes the sr, is placed in the program counter pc. the old pc containing the return address is saved in ld; the old supervisor - state flag s is also saved in bit zero of ld. the old status register sr is saved in ldf; the saved instruction - length code ilc contains the length (2 or 3) of the call instruction. then the frame pointer fp is incremented by the value of the ld - code (ld - code = 0 is interpreted as ld - code = 16) and the frame length fl is set to six, thus creating a new stack frame. the cache - mode flag m is cleared. all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc. t he value of the ld - code must not exceed the value of the old fl (fl = 0 is inter preted as fl = 16), otherwise the beginning of the register part of the stack at the sp could be overwritten without any warning. bit zero of const must be 0. rs and ld may de note the same register. format notation operation lrconst call ld, rs, const if rs denotes not sr then or call ld, 0, const pc := rs + const; else pc := const; ld := old pc(31..1)//old s; -- ld - code 0 selects l16 ldf := old sr; fp := fp + ld code; -- ld - code 0 is treated as 16 fl := 6; m := 0; note: at the new stack frame, the saved pc is located in l0 and the saved sr is located in l1. a frame instruction must be executed immediately after a call instruction, otherwise an interrup t, parity error, extended overflow or trace exception could separate the call from the corresponding frame instruction before the frame pointer fp is decremented to include (optionally) passed parameters. after a call instruction, an interrupt, parity erro r, extended overflow or trace exception is locked out for one instruction regardless of the interrupt lock flag l. _main: frame l4, l0 movd l2, g10 call l6, 0, sub_start ; pc = sub_start movd g10, l2 ret pc, l0 sub_start: frame l3, l0 movi l2, $124 ret pc, l0
3 - 34 chapter 3 3 . 28 trap instructions the trap instructions trap and any of the conditional trap instructions when the trap condition is met, cause a branch to one out of 64 supervisor subprogram ent ries (see section 2.4. entry tables ). when the trap condition is not met, instruction execution proceeds sequentially. when the subprogram branch is taken, the subprogram entry address adr is placed in the program counter pc and the supervisor - state flag s is set to one. the old pc containing the return address is saved in the register addressed by fp + fl; the old s flag is also saved in bit zero of this register. the old status register sr is saved in the register addressed by fp + fl + 1 (fl = 0 is inter preted as fl = 16); the saved instruction - length code ilc contains the length (1) of the trap instruction. then the frame pointer fp is incremented by the old frame length fl and fl is set to six, thus creating a new stack frame. the cache - mode flag m and the trace - mode flag t are cleared, the interrupt - lock flag l is set to one. all condition flags remain unchanged. then instruction execution proceeds at the entry address placed in the pc. the trap instructions are differentiated by the 12 code values give n by the bits 9 and 8 of the op - code and bits 1 and 0 of the adr - byte (code = op(9..8)//adr - byte(1..0)). since op(9..8) = 0 does not denote trap instructions (the code is occupied by the br instruction), trap codes 0..3 are not available. format is pcadr code notation operation 4 traple trapno if n = 1 or z = 1 then execute trap else execute next instruction; 5 trapgt trapno if n = 0 and z = 0 then execute trap else execute next instruction; 6 traplt trapno if n = 1 then execute trap else execute nex t instruction; 7 trapge trapno if n = 0 then execute trap else execute next instruction; 8 trapse trapno if c = 1 or z = 1 then execute trap else execute next instruction; 9 trapht trapno if c = 0 and z = 0 then execute trap else execute next instruc tion; 10 trapst trapno if c = 1 then execute trap else execute next instruction; 11 traphe trapno if c = 0 then execute trap else execute next instruction; 12 trape trapno if z = 1 then execute trap else execute next instruction; 13 trapne trapno i f z = 0 then execute trap else execute next instruction; 14 trapv trapno if v = 1 then execute trap else execute next instruction; 15 trap trapno pc := adr; s := 1; (fp + fl)^ := old pc(31..1)//old s; (fp + fl + 1)^ := old sr; fp := fp + fl ; -- fl = 0 is treated as fl = 16 fl := 6; m := 0; t := 0; l := 1;
instruction set 3 - 35 trapno indicates one of the traps 0..63. note: at the new stack frame, the saved pc is located in l0 and the saved sr is located in l1; l2..l5 are free for use as required. a fr ame instruction must be executed before executing any other trap, call or soft ware instruction or before the interrupt - lock flag l is being cleared, otherwise the beginning of the register part of the stack at the sp could be overwritten without any warni ng. 3 . 29 frame instruction a frame instruction restructures the current stack frame by decrementing the frame pointer fp to include (optionally) passed parameters in the local register addressing range; the first parameter passed is then addres sable as l0; resetting the frame length fl to the actual number of registers needed for the current stack frame. it also restores the reserve number of 10 registers in the register part of the stack to allow any fur ther call, trap or software instructions and clears the cache mode flag m. the frame pointer fp is decremented by the value of the ls - code and the ld - code is placed in the frame length fl (fl = 0 is always interpreted as fl = 16). then the difference (avai lable number of registers) - (required number of registers + 10) is evaluated and interpreted as a signed 7 - bit integer. if the difference is not negative, all the registers required plus the reserve of 10 fit into the register part of the stack; no furthe r action is needed and the frame instruction is finished. if the difference is negative, the content of the old stack pointer sp is compared with the address in the upper stack bound ub. if the value in the sp is equal or higher than the value in the ub, a temporary flag is set. then the contents of the number of local registers equal to the negative difference evaluated are pushed onto the memory part of the stack, beginning with the content of the local register ad dressed absolutely by sp(7..2) being pus hed onto the location addressed by the sp. after each memory cycle, the sp is incremented by four until the difference is eli minated. a trap to frame error occurs after completion of the push operation when the temporary flag is set. all condition flags r emain unchanged.
3 - 36 chapter 3 format notation operation ll frame ld, ls fp := fp - ls code; fl := ld code; m := 0; difference(6..0) := sp(8..2) + (64 - 10) - (fp + fl); -- fl = 0 is treated as fl = 16 -- difference is signed, difference(6) = sign bit - - 64 = number of local registers -- 10 = number of reserve registers if difference 3 0 then continue at next instruction; -- frame is finished else temporary flag := sp 3 ub; repeat memory sp^ := register sp(7..2)^; -- local reg ister t memory sp := sp + 4; difference := difference + 1; until difference = 0; if temporary flag = 1 then trap t frame error; note: ls also identifies the same source operand that must be denoted by the re turn instruction to address th e saved return pc. ld (l0 is interpreted as l16) also identifies the register in which the return pc is being saved by a trap or software instruction or by an exception; therefore only local registers with a lower register code than the interpreted ld - code of the frame instruction may be used after execution of a frame instruction. the reserve of 10 registers is to be used as follows: a call, trap or software instruction uses six registers. a subsequent exception, occurring before a frame instruction is executed, uses another two registers. two registers remain in reserve. note that the frame instruction can write into the memory stack at address locations up to 37 words higher than indicated by the address in the ub. this is due to the fact that the u pper bound is checked before the execution of the frame instruction. attention: the frame instruction must always be the first instruction executed in a function entered by a call instruction, otherwise the frame instruction could be separated from the pre ceding call instruction by an interrupt, parity error, extended overflow or trace exception (see section 3.27. call instruction ). _main: frame l3, l0 ; l0 = sp ; l1 = sr movd l2, g10 ret pc, l0
instruction set 3 - 37 3 . 30 return instruction the return instruction returns control from a subprogram entered through a call, trap or software instruction or an exception to the instruction located at the return address and restores the status from the saved return status. t he source operand pair rs//rsf is placed in the register pair pc//sr. the program counter pc is restored first from rs. then all bits of the status register sr are re placed by rsf, except the supervisor flag s, which is restored from bit zero of rs and ex cept the instruction length code ilc, which is cleared to zero. if the return occurred from user to supervisor state or if the interrupt - lock flag l was changed from zero to one on return from any state to user state, a trap to pri vilege error occurs. exc eption processing saves the restored contents of the register pair pc//sr; an illegally set s or l flag is also saved. then the difference between frame pointer fp - stack pointer sp(8..2) is evaluated and interpreted as a signed 7 - bit integer. if the diff erence is not negative, the regi ster pointed to by fp(5..0) is in the register part of the stack; no further action is then required and the return instruction is completed. if the difference is negative, the number of words equal to the negative differen ce are pulled from the memory part of the stack and transferred to the register part of the stack, beginning with the contents of the memory location sp - 4 being trans ferred to the local register addressed absolutely by bits 7..2 of sp - 4. after each me mory cycle, the sp is decremented by four until the difference is eliminated. the return instruction shares its basic op - code with the move double - word instruc tion. it is differentiated from it by denoting the pc as destination register rd. the pc or the sr must not be denoted as a source operand; these notations are re served for future expansion. format notation operation rr ret pc, rs old s := s; old l := l; pc := rs(31..1)//0; sr := rsf(31..21)//00//rs(0)//rsf(17..0); -- ilc := 0; -- s := rs(0); if old s = 0 and s = 1 or s = 0 and old l = 0 and l = 1 then trap t privilege error; difference(6..0) := fp - sp(8..2); -- difference is signed, difference(6) = sign bit if difference 3 0 then continue at next instruction; -- ret is finished else repeat sp := sp - 4; register sp(7..2)^ := memory sp^; -- memory t local register difference := difference + 1; until difference = 0;
3 - 38 chapter 3 3 . 31 fetch instruction the instruction execution is halted until a number of at least n/2 + 1 (n = 0, 2, 4..30) instruc tion half - words succeeding the fetch instruction are prefetched in the instruction cache. since instruction words are fetched, one more half - word may be fetche d. the number n/2 is derived by using bits 4..1 of n, bit 0 of n must be zero. the fetch instruction must not be placed as a delay instruction; when the preceding branch is taken, the prefetch is undefined. the fetch instruction shares the basic op - code se txx, it is differentiated by denoting the sr for the rd - code (see section 2.3. instruction formats ). n format notation operation 0 rn fetch 1 wait until 1 instruction half - word is fetched; . . . . . . . . . 30 rn fetch 16 wait until 16 instruction half - words are fetched note: the fetch instruction supplements the standard prefetch of instruction words. it may be used to speed up the execution of a sequence of memory instructions by avoiding alternating between instruction and data memory pages. by e xecuting a fetch instruction preceding a sequence of memory instructions addressing the same data memory page, the memory accesses can be constrained to the data memory page by prefetching all required instructions in advance. a fetch instruction may also be used preceding a branch into a program loop; thus, flushing the cache by the first branch repeating the loop can be avoided.
instruction set 3 - 39 3 . 32 extended dsp instructions the extended dsp functions use the on - chip multi ply - accumulate unit. single word results always use register g15 as destination register, while double - word results are always placed in g14 and g15. the condition flags remain unchanged. format notation operation llext emul ld, ls g15 := ld * ls; -- si gned or unsigned multiplication, single word product llext emulu ld, ls g14//g15 := ld * ls; -- unsigned multiplication, double word product llext emuls ld, ls g14//g15 := ld * ls; -- signed multiplication, double word product llext emac ld, ls g15 := g15 + ld * ls; -- signed multiply/add, single word product sum llext emacd ld, ls g14//g15 := g14//g15 + ld * ls; -- signed multiply/add, double word product sum llext emsub ld, ls g15 := g15 - ld * ls; -- signed multiply/subtract, single word p roduct difference llext emsubd ld, ls g14//g15 := g14//g15 - ld * ls; -- signed multiply/subtract, double word product difference llext ehmac ld, ls g15 := g15 + ld(31..16) * ls(31..16) + ld(15..0) * ls(15..0); -- signed half - word multiply/add, singl e word product sum llext ehmacd ld, ls g14//g15 := g14//g15 + ld(31..16) * ls(31..16) + ld(15..0) * ls(15..0); -- signed half - word multiply/add, double word product sum llext ehcmuld ld, ls g14 := ld(31..16) * ls(31.. 16) - ld(15..0) * ls(15..0); g15 := ld(31..16) * ls(15..0) + ld(15..0) * ls(31..16); -- half - word complex multiply llext ehcmacd ld, ls g14 := g14 + ld(31..16) * ls(31..16) - ld(15..0) * ls(15..0); g15 := g15 + ld(31..16) * ls(15..0) + ld(15..0) * l s(31..16); -- half - word complex multiply/add llext ehcsumd ld, ls g14(31..16) := ld(31..16) + g14; g14(15..0) := ld(15..0) + g15; g15(31..16) := ld(31..16) - g14; g15(15..0) := ld(15..0) - g15; -- half - word (complex) add/subtract -- ls is not used and should denote the same register as ld llext ehcfftd ld, ls g14(31..16) := ld(31..16) + (g14 >> 15); g14(15..0) := ld(15..0) + (g15 >> 15); g15(31..16) := ld(31..16) - (g14 >> 15); g15(15..0) := ld(15..0) - (g15 >> 15); -- half - word (compl ex) add/subtract with fixed - point adjustment -- ls is not used and should denote the same register as ld
3 - 40 chapter 3 the instructions emac through ehcfftd can cause an extended overflow exception when the extended overflow exception flag is enabled (fcr(16) = 0) . note that this overflow occurs asynchronously to the execution of the extended dsp instruction and any succeeding instructions. attention: a new extended dsp instruction can be started before the extended overflow exception trap is executed! an extended dsp instruction is issued in one cycle; the processor starts execution of the next instructions before the extended dsp instruction is finished. the execution of succeeding non - extended - dsp instructions is only stopped and wait cycles are inserted when an instruction addresses g15 or g14//g15 respectively before a preceding extended dsp instruction placed its result into g15 or g14//g15. thus, dsp programs can place load/store or loop administration instructions into the slot cycles between issue of an exte nded dsp instruction and availability of its result. see also section 2.5. instruction timing . register l0 : $12344321 l1 : $56788765 g14 : $11112222 g15 : $33334444 instruction emul l0, l1 ; g15 = l0 * l1 = $4b7ce305 emulu l0, l1 ; g14//g15 = l0 * l1 ; g14 = $062620ad, g15 = $4b7ce305 emac l0, l1 ; g15 = g15 + l0 * l1 = $7eb02749 ehcmuld l0, l1 ; g14 = $25c61d5b ; = l0(31..16)*l1(31..16) - l0(15..0)*l1(15..0) ; g15 = $0e1927fc ; = l0(31..16)*l1 (15..0) + l0(15..0)*l1(31..16) ehcfftd l0, l1 ; g14(31..16) = $3456 = l0(31..16) + (g14>>15) ; = $06260060 ; g14(15..0) = $a987 = l0(15..0) + (g15>>15) ; = $06260060 ; g15(31..16) = $f012 = l0(31..16) - (g14>>15) ; = $062600 60 ; g15(151..0) = $dcbb = l0(15..0) - (g15>>15) ; = $06260060
instruction set 3 - 41 3 . 33 software instructions the software instructions cause a branch to the subprogram associated with each software instruction. its entry address (see section 2.4. entry tables ), deduced from the op - code of the software instruction, is placed in the program counter pc. data is saved in the register sequence beginning at register address fp + fl (fl = 0 is interpreted as fl = 16) in as cending order as follows: stack address of the destination operand high - order word of the source operand low - order word of the source operand old program counter pc, containing the return address and the old s flag in bit zero old status register sr, ilc contains the instruction - length code (ilc = 1) of the software instruction then the frame pointer fp is incremented by the old frame length fl and fl is set to six, thus creating a new stack frame. the cache - mode flag m and the trace - mode flag t a re cleared, the interrupt - lock flag l is set to one. all condition flags remain unchanged. instruction execution then proceeds at the entry address placed in the pc. ls or lsf and ld may denote the same register. format notation operation ll see specific p c := 23 ones//0//op(11..8)//4 zeros; instructions (fp + fl)^ := stack address of ld; (fp + fl + 1)^ := ls; (fp + fl + 2)^ := lsf; (fp + fl + 3)^ := old pc(31..1)//old s; (fp + fl + 4)^ := old sr; fp := fp + fl; -- fl = 0 is treated as fl = 16 fl := 6; m := 0; t := 0; l := 1; note: at the new stack frame, the stack address of the destination operand can be addressed as l0, the source operand as l1//l2, the saved pc as l3 and the saved sr as l4; l5 is free for use as required. a frame instr uction must be executed before executing any other software instruc tion, trap or call instruction or before the interrupt - lock flag l is being cleared, otherwise the beginning of the register part of the stack at sp could be overwritten without any warnin g.
3 - 42 chapter 3 3 . 33 . 1 do instruction the do instruction is executed as a software instruction. the associated subprogram is entered, the stack address of the destination operand and one double - word source operand are passed to it (see section 3.33. software instructions for details). the half - word succeeding the do instruction will be used by the associated subprogram to differentiate branches to subordinate routines; the associated subprogram must in crement the saved retur n program counter pc by two. format notation operation ll do xx... ld, ls execute software instruction; "xx..." stands for the mnemonic of the differentiating half - word after the op - code of the do instruction. the do instruction must not be placed as dela y instruction since then xx... cannot be located. note: the do instruction provides very code efficient passing of parameters to rou tines executing software implemented extensions of the instruction set. branching to unimplemented subordinate routines wit h the interrupt - lock flag l set to one must be excluded by bounds checks of the differentiating half - word at runtime; out - of - range values cannot be securely excluded at the assembly level. the l flag must be cleared when the execution of a subordinate rout ine exceeds the regular interrupt latency time. application note: the definition of subprograms entered via the do instruction is re served for system implementations. the values assigned to the differentiating half - word xx... after the op - code of the do i nstruction must be in ascending and contiguous order, starting with zero. this order enables fast range checking for an upper bound and also avoids unused space in the differentiating branch table.
instruction set 3 - 43 3 . 33 . 2 floati ng - point instructions the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. the following description provides a general overview of the architectural integration. t he basic instructions use single - precision (single - word) and double - precision (double - word) operands. floating - point instructions must not be placed as delay instructions ( see 3.26. delayed branch instructions ). except at the floating - point compare instruc tions, all condition flags remain unchan ged to allow future concurrent execution. the rounding modes frm are encoded as: sr(14) sr(13) description 0 0 round to nearest 0 1 round toward zero 1 0 round toward - infinity 1 1 round toward + infinity the floating - point trap enable flags fte and the exception flags are assigned as: floating - point trap enable fte accrued exceptions actual exceptions exception type sr(12) g2(4) g2(12) invalid operation sr(11) g2(3) g2(11) division by zero sr(10) g2(2) g2(1 0) overflow sr(9) g2(1) g2(9) underflow sr(8) g2(0) g2(8) inexact the reserved bits g2(31..13) and g2(7..5) must be zero. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the ope rand word containing the exponent; all other bi ts of the operand are ignored for dif ferentiating a nan from a non - nan. in the case of an operand word containing a nan, bit zero = 0 differentiates a quiet nan, bit zero = 1 differentiates a signaling nan; the bits 18..1 may be used to en code further in formation. the floating - point instruction supports the five ieee standard 754 - 1985 exceptions: inexact (i) overflow (o) underflow (u) division by zero (z) invalid operation (v)
3 - 44 chapter 3 the following sections describe the conditions that cause the floatin g - point instruction to generate each of its exceptions and the details the floating - point instruction response to each exception - causing situation. inexact exception (i) the floating - point instruction generates the inexact exception if the result of an ope ration is not exact or if it overflows. floating - point trap enabled results: if inexact exception traps are enabled, the result register is not modified and the source registers are preserve. floating - point trap disabled results: the rounded or overflowed result is delivered to the destination register if no other software trap occurs. overflow exception (o) the overflow exception is signaled when the magnitude of the rounded floating - point result, if the exponent range were to be unbounded, is larger than the destination format?s largest finite number. (this exception also sets the inexact exception and flag bits.) floating - point trap enabled results: the result register is not modified, and the source registers are preserved. floating - point trap disabled r esults: the result, when no trap occurs, is determined by the rounding mode and the sign of the intermediate result. division by zero (z) the division by zero exception is signaled on and implemented divide operation if the divisor is zero and the dividend is a finite non - zero number. software can simulate this exception for other operations that produce a signed infinity, such as ln(0), sec( p /2), csc(0), or 0 - 1 . floating - point trap enabled results: the result register is not modified, and the source regist er is preserved. floating - point trap disabled results: the result, when no trap occurs, is a correctly signed infinity.
instruction set 3 - 45 invalid operation exception (v) the invalid operation exception is signaled if one or both of the operand are invalid for an implemente d operations. the mips isa defines the result, when the exception occurs without a trap, as a quiet not a number (nan). the invalid operations are: addition or subtraction: magnitude subtraction of infinities, such as: ( + inf ) + ( - inf ) or ( - inf ) - ( - inf ) multiplication: 0 times +inf, with any signs. division: 0/0, or inf/inf, with any signs. conversion of a floating - point number to a fixed - point format when an overflow, or operand value of infinity or nan, pr ecludes a faithful representation in that format. comparison of predicates involving < or > without ?, when the operands are unordered. any arithmetic operation on a signaling nan. a move (mov) operation is not considered to be an arithmetic operation, but absolute value (abs) and negate (neg) are considered to be arithmetic operations and cause this exception if one or both operands is a signaling nan. square root: sqrt(x), where x is less than zero. floating - point trap enabled results: the original operand values are undisturbed. floating - point trap disabled results: the fpu always signals an unimplemented exception because it does not create the nan that the ieee standard specifies should be returned these circumstances. underflow exception (u) two related events contribute to the underflow exception: the creation of a tiny non - zero result between +2 emin and - 2 emin which can cause some later exception because it is so tiny. the extraordinary loss of accuracy during the approximation of such tiny numbers by de n or m alized numbers. floating - point trap enabled results: when an underflow trap is enabled, underflow is signaled when tininess is detected regardless of loss of accuracy. if underflow traps are enabled, the result register is not modified, an d the source registers are preserved. floating - point trap disabled results: when an underflow trap is not enabled, underflow is signaled (using the underflow flag) only when both tininess and loss of accuracy have been detected. the delivered result might be zero, denormalized, or +2 emin and - 2 emin .
3 - 46 chapter 3 format notation operation ll fadd ld, ls ld := ld + ls; ll faddd ld, ls ld//ldf := (ld//ldf) + (ls//lsf); ll fsub ld, ls ld := ld - ls; ll fsubd ld, ls ld//ldf := (ld//ldf) - (ls//lsf); ll fmul ld, ls ld := ld * ls; ll fmuld ld, ls ld//ldf := (ld//ldf) * (ls//lsf); ll fdiv ld, ls ld := ld / ls; ll fdivd ld, ls ld//ldf := (ld//ldf) / (ls//lsf); ll fcvt ld, ls ld := ls//lsf; -- convert double t single ll fcvtd ld, ls ld//ldf := ls; -- convert single t double ll fcmp ld, ls result := ld - ls; z := ld = ls and not unordered; n := ld < ls or unordered; c := ld < ls and not unordered; v := unordered; if unordered then invalid operation exception; ll fcmpd ld, ls result := (ld//ldf) - (ls//lsf ); z := (ld//ldf) = (ls//lsf) and not unordered; n := (ld//ldf) < (ls//lsf) or unordered; c := (ld//ldf) < (ls//lsf) and not unordered; v := unordered; if unordered then invalid operation exception; ll fcmpu ld, ls result := ld - ls; z := l d = ls and not unordered; n := ld < ls or unordered; c := ld < ls and not unordered; v := unordered; -- no exception ll fcmpud ld, ls result := (ld//ldf) - (ls//lsf); z := (ld//ldf) = (ls//lsf) and not unordered; n := (ld//ldf) < (ls//lsf) or un ordered; c := (ld//ldf) < (ls//lsf) and not unordered; v := unordered; -- no exception a floating - point instruction, except a floating - point compare, can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. f cmp and fcmpd can raise only the invalid operation exception (at unordered). fcmpu and fcmpud cannot raise any exception.
instruction set 3 - 47 at an exception, the following additional action is performed: any corresponding accrued - exception flag whose corresponding trap - en able flag is zero (not enabled) is set to one; all other accrued - exception flags remain un changed. if a corresponding trap - enable flag is one (enabled), any corresponding actual - ex ception flag is set to one; all other actual - exception flags are cleared . the de stination remains unchanged. in the present software version, the software emulation routine must branch to the corresponding user - supplied exception trap handler. the (modified) result, the source operand, the stack address of the destination ope rand and the address of the floating - point instruction are passed to the trap handler. in the future hardware version, a trap to range error will occur; the range error handler will then initiate re - execution of the floating - point instruction by branching to the entry of the corresponding software emulation routine, which will then act as described before. the only exceptions that can coincide are inexact with overflow and inexact with underflow. an overflow or underflow trap, if enabled, takes precedence o ver an in exact trap; the inexact accrued - exception flag g2(0) must then be set as well. the table below shows the combinations of floating - point compare and branch in - structions to test all 14 floating - point relations: relation compare branch on true bran ch on false exception if unordered = fcmpu be bne -- ? 1 fcmpu bne be -- > fcmp bgt ble x 3 fcmp bge blt x < fcmp blt bge x fcmp ble bgt x ? fcmpu bv bnv -- 1 fcmp bne be x < = > fcmp -- -- x ? > fcmpu bht bse -- ? 3 fcmpu bhe bst -- ? < fcmpu blt bge -- ? fcmpu ble bgt -- ? = fcmpu be, bv bst, bgt -- the symbol ? signifies unordered. note: at the test < = > (ordered), no branch after fcmp is required since the result of the test is an invalid operation exception occurred or not occurred.

exceptions 4 - 1 4 . exceptions 4 . 1 e xception processing exceptions and interrupts are events other than branches or jumps that change the normal flow of instruction execution. an exception is an unexpected event from within the processor, arithmetic overflow is an example of an exception. an interrupt is an event that al so causes an unexpected change in control flow but comes from outside of the processor. interrupts are used by i/o devices to communicate with the processor. exceptions are events that redirect the flow of control to a supervisor subprogram associated with the type of exception, that is, a trap occurs as a response to the exception. (see a detailed description of exceptions further below.) if exceptions coincide, the exception with the highest priority takes precedence over all exceptions with lower priorit y. processing of an exception proceeds as follows: the entry address (see section 2.4. entry tables ) of the associated subprogram is placed in the program counter pc and the supervisor - state flag s is set to one. the old pc is saved in the register address ed by fp + fl; the old s flag is also saved in bit zero of this register. the old status register sr is saved in the register addressed by fp + fl + 1 (fl = 0 is interpreted as fl = 16); the saved instruction - length code ilc contains (in general, see secti on 4.3. exception backtracking ) the instruction - length code of the preceding instruction. then the frame pointer fp is incremented by the old frame length fl and fl is set to two, thus creating a new stack frame. the cache - mode flag m and the trace - mode fl ag t are cleared, the interrupt - lock flag l is set to one. all condition flags remain unchanged. operation pc := entry address of exception subprogram; s := 1; (fp + fl)^ := old pc(31..1)//old s; (fp + fl + 1)^ := old sr; fp := fp + fl; -- fl = 0 is treated as fl = 16 fl := 2; m := 0; t := 0; l := 1; note: at the new stack frame, the saved pc can be addressed as l0 and the saved sr as l1. since fl = 2, no other local registers are free for use. a frame instruction must be executed before the interrupt - lock flag l is cleared, before any call, trap, software instruction or any instruction with the potential to cause an exception is executed. otherwise, the beginning of the register part of the stack at the sp could be overwritten without an y warning. an entry caused by an exception can be differentiated from an entry caused by a trap instruction by the value of fl: fl is set to two by an exception and set to six by a trap instruction.
4 - 2 chapter 4 4 . 2 excep tion types the following exceptions are types ordered by priorities, reset has the highest priority. in case of coincidental exceptions, higher - priority exceptions overrule lower - priority exceptions. 4 . 2 . 1 reset a reset exception occurs on a transition of the reset# signal from low to high or as a result of a watchdog overrun in io3 watchdog mode or after a reset following a clock - down command. the reset exception overrules all other exceptions and is used to star t execution at the reset entry. the load and store pipelines are cleared . the bcr, mcr, fcr and tpr initialization in the three reset cases is specified in the table 4.1; all other registers and flags, except those set or cleared explicitly by the exceptio n processing itself, remain undefined and must be initialized by software. in the reset handler, isr bits 9 and 10 can be used to discriminate between the three reset sources. reset source bcr mcr fcr tpr reset# initialized initialized initialized initial ized watchdog initialized initialized initialized preserved clock - down initialized initialized preserved initialized table 4 . 1 : memory address spaces the fcr is preserved on a clock - down reset in order to have the correct in terrupt mask and polarity for the wakeup from clock - down. tpr is preserved on a watchdog reset to allow the use of the watchdog reset as a controlled time - out without losing the time base. the other registers are initialized to their specific reset value. note: the frame pointer fp can only be set to a defined value by restoring it from the fp in the return sr through a return instruction. 4 . 2 . 2 range, pointer, frame and privilege error these exceptions share a co mmon entry since they cannot occur coincidentally at the same instruction. the error - causing instruction can be identified by backtracking. a range error exception occurs when an operand or result exceeds its value range. a pointer error is caused by an at tempted memory access using an address register (rd or ld) with the content zero. the memory is not accessed, but the content of the address register is updated in case of a postincrement or next address mode. a frame error occurs when the restructuring of the stack frame reaches or exceeds the upper bound ub of the memory part of the stack. no further frame instruction must be executed by the error routine for pointer, frame and privilege error before the ub is set to a higher value and thus, an expanded s tack frame fits into the higher stack bound. a privilege error occurs when a privileged operation is executed in user or on return to user state (see section 1.5. privilege states for details).
exceptions 4 - 3 4 . 2 . 3 extended ove rflow an extended overflow condition is raised on an overflow caused by an add or subtract operation as part of the execution of one of the extended instructions emac through ehcfftd when the extended overflow exception is enabled. the extended overflow ex ception is enabled by clearing bit 16 of the function control register fcr to zero. when the extended overflow exception is blocked by a higher - priority exception or by the l flag being set, the extended overflow condition is saved internally; the exceptio n trap occurs then when the blocking is released. the extended overflow condition is cleared by the exception trap or by setting fcr(16) to one (disabled). the extended overflow exception trap occurs asynchronously to the causing instruction; thus, the cau sing instruction cannot be identified by backtracking. usually, there is only one instruction in a loop that can cause an extended overflow exception; thus, a handler can identify that instruction. when a second extended overflow condition is raised before the first one caused a trap, it is ored and only one trap is taken. 4 . 2 . 4 parity error a parity error exception can be enabled individually for each of the memory areas mem0..mem3. when enabled, a parity error o n an access to the corresponding memory area causes a parity error exception. when the parity error exception is blocked by a higher - priority exception or by the l flag being set, the parity error condition is saved internally, the exception trap occurs th en when the blocking is released. the parity error condition is cleared only by the exception trap; it is not cleared by setting any of the disable bits 31..28 in the bcr after a parity error condition is saved internally. the parity error exception trap o ccurs asynchronously to the causing memory instruction. since memory accesses are pipelined, a parity error exception cannot be related to a specific memory instruction. 4 . 2 . 5 interrupt an interrupt exception is caused by an external interrupt signal, by the timer interrupt or by an io3 control mode. since the interrupt - lock flag l is set by the exception processing, no further interrupts can occur until the l flag is cleared. the interrupt exception processing se ts also the interrupt - mode flag i to one. see also sections 2.4. entry tables, 5. timer and 6.9. bus signals . the i flag is used by the operating system, it must not be cleared by the interrupt handler. a return instruction restores the old value from the saved sr automatically.
4 - 4 chapter 4 4 . 2 . 6 trace exception a trace exception occurs after each execution of an instruction except a delayed branch instruction when the trace mode is enabled (trace flag t = 1) and the trace p ending flag p is one. after a call instruction, a trace exception is suppressed until the next instruction is executed regardless of the trace mode being enabled; the t flag is not affected. the p flag in the saved return status register sr must be cleared by the trace handler to prevent tracing the same instruction again. the instruction preceding the trace exception cannot be backtracked since only poten tially error - causing instructions can and need be backtracked. 4 . 3 exception backtracking in the case of a pointer, frame, privilege and range error exception caused by a delay instruction succeeding a delayed branch taken, the location of the saved pc contains the address of the delay instruction and the sav ed instruction length code ilc contains the length of the delayed branch instruction (in half - words). in the case of all other exceptions, the location of the saved pc contains the return address, that is, the address of the instruction that would have bee n executed next if the exception had not occurred. the saved ilc contains the length of the last instruction except when the last instruction executed was a branch taken; a return instruction clears the ilc and thus, the saved ilc after a return instructio n contains zero. an exception caused by a pointer, frame, privilege or range error, except following a return instruction, can be backtracked. for backtracking, the content of the adjusted saved ilc is subtracted from the address contained in the location of the saved pc. if the backtrack - address calculated in this way points to a delayed branch instruction, the error - causing instruction is a delay instruction with a preceding delayed branch taken and the address contained in the location of the saved pc po ints to the address of this delay instruction. if the backtrack - address calculated does not point to a delayed branch instruction, it points directly to the error - causing instruction. this instruction is then either not a delay instruction or a delay instr uction with the preceding delayed branch not taken. the error - causing instruction can then be inspected and the cause of an error analyzed in detail. in the case of a privilege error, the ilc must be tested for zero to single out an exception caused by a r eturn instruction before backtracking. thus, an exception caused by a return instruction can be identified. however, it cannot be backtracked to the instruction address of the return instruction because the return address saved does not succeed the address of the return instruction. all other branching instructions cannot be backtracked either. since these instructions cause no errors, backtracking is not required.
exceptions 4 - 5 the stack address of a local register denoted by a backtracked instruction can be calculated according to the following formula: stack address of preceding stack frame := stack address of current stack frame - (((fp - saved fp) modulo 64) * 4); -- bits 5..0 of the difference (fp - saved fp) are used zero - expanded -- * 4 converts word differe nce t byte difference -- the stack address of the current stack frame is provided by the set stack address instruction stack address of local register := stack address of preceding stack frame + (local register address code * 4); -- * 4 converts lo cal register word offset t byte offset note: backtracking allows a much more detailed analysis of error causes than a more differentiated trapping could provide. exception handlers can get more information about error causes and the precise messages requir ed by most programming languages can be easily generated.

timer 5 - 1 5 . timer and cpu clock modes 5 . 1 overview the on - chip timer is controlled via three registers: timer prescaler register tpr g21 timer register tr g23 timer compare register tcr g22 g21..g23 can be addressed only via the high global flag h by a mov or movi instruction. the co ntent of g21 (timer prescaler register) cannot be read. the write - only tpr sets a carry flag c (overflow) when the value of the counter in tpr equals to the content of tpr, and transfers carry flag c to the tr. when the tpr transfers carry flag to the tr, tr increments by one on modulo 2 32 . timer clock frequency is determined by the content of tpr. when the tr higers than or equals to the tcr, the timer interrupt is generated. tr tcr x timer interrupt tpr processor clock frequency timer clock frequency carry compare fig. 5.1 the block diagram of on - chip timer. 5 . 1 . 1 timer prescaler register tpr global register g21 is the write - only timer prescaler register tpr. the tpr adapts the timer clock to different processor clock frequencies and controls the pll clock output. bits 26 and 27 select the process or clock. bits 23..16 determine the basic time unit frequency of timer clock := frequency of processor clock divided by (n+2) n is the value to be loaded into the tpr at the bit positions 23..16, it is calculated according to the formula: n = (time unit * frequency of processor clock) - 2 bit 31 determines the effect of a write to tpr. if bit 31 is 0, a write to tpr takes effect immediately, the processor clock divider is changed and the timer prescaler divider is reloaded. if bit 31 is 1, the processor cl ock divider and timer prescaler divider update is delayed until the current basic time unit ends. at the end of the current time unit, the processor clock divider and the timer prescaler divider are updated with the new values. this allows keeping absolute timing even when the
5 - 2 chapter 5 processor clock is changed by simultaneously changing the processor clock divider and the timer prescaler divider. the tpr is initialized to bit 27=1, bits 26 and 23..16=0 on reset (from the rteset# pin or by a clock - down reset), i.e. the processor starts with cpu clock = xtal1 clock, the prescaler divides by 2. during a watchdog (io3 timer) reset, the tpr is preserved, this allows the use of the watchdog as a controlled time - out without losing the time base. bits 30..28, 25..24 and 15 ..0 are reserved and must be zero on a move to tpr. bits name description 31 loadenable 1 = tpr update is de3layed until current prescaler time unit ends 0 = t pr update is performed immediately 30..28 reserved 27..26 clockdivider cpu clock divider con trol 11 = cpu clock = xtal1 clock / 2 1 0 = cpu clock = xtal1 clock 01 = cpu clock = xtal1 clock * 2 00 = cpu clock = xtal1 clock * 4 25..24 reserved 23..16 timerprescaler timer prescaler division factor n range n = 0..255, timer prescaler divides by n+2 15..0 reserved table 5 . 1 : memory address spaces 5 . 1 . 2 timer register tr the tr is a 32 - bit register that is incremented by one on each time unit modulo 2 32 . its content can be use d as the lower word of a double - word integer, representing the time inclusive date. the tpr and the tr should be set only once on system initialization, whereby the following instruction sequence must be observed strictly (interrupts must be locked out): : : fetch 4 ori sr, $20 ; set h - flag mov tpr, lx ; load prescaler register from local register x ori sr, $20 ; set h - flag mov tr, ly ; load timer register from local register y : : note: the fetch instruction is necessary to prevent insertion of idle cycles during the prescripted instruction sequence.
timer 5 - 3 5 . 1 . 3 timer compare register tcr the content of the tcr is co mpared continuously with the content of the timer register tr. an unsigned modulo comparison is performed according to: result(31..0) := tr(31..0) - tcr(31..0) on result(31) = 0, the tr is higher than or equal to the tcr. when the timer interrupt is enable d (fcr(23) = 0) and the value in the tr is higher than or equal to the value in the tcr, a timer interrupt is generated. this interrupt is cleared by loading the tcr with a value higher than the current content of the tr. timer interrupts can be masked out by fcr(23) = 1; fcr(23) is set to one on reset. the timer interrupt disable bit fcr(23) does not affect the timer and compare function. a delay time in the tcr is calculated according to the formula: tcr := current content of tr + number of delay time uni ts the maximum number of delay time units allowed for this calculation is 2 31 - 1. for example: tr(31..0) = hex ffff ff00 delay time units (= 1000) = hex 0000 03e8 tcr(31..0) = hex 0000 02e8 since the modulo comparison is an unsigned operation, only unsigned arithmetic must be used for calculations with timer and timer compare values. do not use the n or c flag to test for the result of the comparison tr - tcr, use only result bit 31! 5 . 1 . 4 power - down mode when the power - down mode is entered, the execution pipeline of the processor is halted. only the logic for the timer, io3 control modes, interrupt and refresh is being clocked, all other clocks are disabled. the processor is temporarily activated for refresh and bu s arbitration cycles, no instructions are executed during these temporary clock cycles. the processor resumes execution by any interrupt or on a reset. power - down mode can be entered by executing an i/o write instruction with address bits a(27) and a(25.. 23) set to one and a(22) set to zero. when power - down mode is entered via the i/o write instruction, the power - down mode takes effect at the time when the i/o access is performed. until this time, instruction execution continues. to ensure that the power - d own mode takes effect, the power - down i/o access can be followed by a dummy load accesses (i/o or memory). a following dependent instruction then waits until both i/o accesses are performed. thus, instructions following the mov instruction are not executed until wakeup. note that even though the power - down request is an internal operation of the processor, bus grant must be given so that the power - down i/o access can be performed.
5 - 4 chapter 5 power - down mode can be set by a program sequence as in the following example : powerdownio equ 1 << 27 | %1110 << 22 ; bits 27, 25..23, 22 . .. stw.ioa 0, 0, powerdownio ; set power - down mode ldw.ioa 0, l4, powerdownio ; wait until power - down mov l4, l4 ; i/o is executed ... ; execution continues ; here after wakeup 5 . 1 . 5 additional power saving the cpu clock divider control can be used for example to switch the cpu to a slow clock during power - down for additional power savings. in the following example, the xtal1 clock is 20 mhz, the cpu runs normally at 80 mhz and is switched back to 10 mhz during power - down. the timer prescaler setting is changed so that a time unit of 1 s is kept through the power - down sequence. using the ?delayed tpr update? feature, the 1 s absolute ti me is maintained even for the time units where the tpr setting changes. interrupts are locked out during power - down using the l bit in sr. this is done so that the tpr setting can be changed back to fast clock and corresponding prescaler setting after wake up from power - down before the interrupt handler is called. the interrupt occurs at the time the lock bit l in sr is cleared. the power - down is initiated by executing the power - down i/o access. the power - down is guaranteed to be effective before the next (d ummy) i/o load access is done, thus the following mov instruction is not executed until wakeup. the instructions to restore the cpu clock speed and the prescaler setting can thus be placed after the dummy load and mov instructions. tpr_fast equ %00 << 26 | 78 << 16 ; fast tpr, divide by 80 tpr_slow equ %11 << 26 | 8 << 16 ; slow tpr, divide by 10 delaytprupd equ 1 << 31 ; delayed tpr update l_bit equ 1 << 15 ; interrupt lock in sr h_bit equ 1 << 5 ; high - global bit in sr powerdownio equ 1 << 27 | %1110 << 22 ; power - down i/o address ... movi l5, tpr_slow ; tpr for power - down movi l6, tpr_fast ; tpr after power - down ori l5, delaytprupd ; set delayed tpr update ori l6, delaytprupd ; set delayed tpr update ori sr, l_bit | h_bi t ; set interrupt lock mov tpr, l5 ; set slow clock stw.ioa 0, 0, powerdownio ; set power - down mode ldw.ioa 0, l4, powerdownio ; dummy load mov l4, l4 ; wait till done ; next instruction is ; executed after wakeup ori sr, h_bit mov t pr, l6 ; restore fast clock andni sr, l_bit ; allow interrupt now ... ; continue here after ; interrupt routine has ; been executed
timer 5 - 5 5 . 1 . 6 sleep mode to further reduce power dissipation, the process or can be set into sleep mode. in this case, the clock of the processor is completely switched off. when a quartz crystal is used for processor clock generation, it is also switched off. an external reset signal or an interrupt awakes the processor from sl eep mode and the processor continues with the standard reset procedure. bit 10 in isr indicates that the reset was caused by a wakeup from sleep mode. the sleep mode can be entered by an i/o write instruction with address bits a(27) and a(25..22) set to on e. note that any content of the internal ram and the external dram as well as the timer count will be lost during sleep mode. the sleep mode takes effect when the i/o access is performed. after this, the processor behaves as in reset, i.e. the bus request is deactivated until wakeup by an interrupt or reset. on wakeup by an interrupt, the fcr setting is preserved through the reset sequence. as with the power - down i/o access, a dummy load access could be placed after the sleep mode i/o access to ensure that the sleep mode takes effect. since the processor continues with a reset at wakeup from sleep mode, an empty loop can be used as well to wait until the sleep mode i/o access has taken effect. note that even though sleep mode is an internal operation of the processor, bus grant must be given so that the sleep mode set i/o access can be performed. an interrupt signal awaking the processor from sleep mode must stay active at least until the processor has begun executing its reset sequence. this latency time inc ludes the startup time of the crystal oscillator and of the pll circuit. if the interrupt goes inactive before this latency time has elapsed, the processor may fall back into sleep mode. in order to have the effect of causing a processor interrupt, the int errupt signal should stay active until it is acknowledged by the interrupt handler. the sleep mode can be set by a program sequence as in the following example: sleepmodeio equ 1 << 27 | %1111 << 22 ; bits 27, 25..22 ... stw.ioa 0, 0, sleepmodeio ; set sleep mode sleepwait: br sleepwait ; wait until sleep ; mode i/o is execute d

bus int erface 6 - 7 6 . bus interface 6 . 1 bus control general the processor provides on - chip all functions for controlling memory and peripheral devices, the including ras - cas multiplexing, d ram refresh and parity generation and checking. the number of bus cycles used for a memory or i/o access is also defined by the processor; thus, no external bus controllers are required. all memory and peripheral devices can be connected directly, pin by p in, without any glue logic. the memory address space is divided into five partitions as follows: address (hex) address space memory type 0000 0000..3fff ffff address space mem0 rom, sram, dram 4000 0000..7fff ffff address space mem1 rom, sram 8000 0000. .bfff ffff address space mem2 rom, sram c000 0000..dfff ffff address space iram internal ram (iram) e000 0000..ffff ffff address space mem3 rom, sram table 6 . 1 : memory address spaces the bus timing, refresh control and parit y error disable for memory access is defined in the bus control register bcr. the bus timing for i/o access is defined by address bits in the i/o address. on a memory or i/o access, the address bus signals are valid through the whole access. on a memory ac cess, the chip select signal for the selected memory area mem0..mem3 is switched to low (active low) through the whole access. on a write access to memory or i/o, the data bus and the parity signals are also activated and the write enable signal we# is swi tched to low through the whole access. a bus wait cycle is inserted automatically to guarantee a minimum of one idle cycle between the end of an output enable signal (oe#, iord#, casx# at read) and the beginning of a subsequent write access. after a dram r ead access with an access time > 2 cycles, an additional bus wait cycle is inserted.
6 - 8 chapter 6 6 . 1 . 1 boot width selection the processor provides two pins ( bootw and bootb) for selecting the data bus widt h for memory area mem3 (boot memory area). table 6.2 shows the encoding for selecting the desired data bus width. the pin state is sampled during reset. bootw bootb data bus width don ? t care high 8 - bit low low 16 - bit high low 32 - bit table 6 . 2 : data bus width encoding for memory area mem3 the pins used for bootb and bootw were used as vcc pins at the gms30c2232 and GMS30C2216 . thus, if the gms30c2232 is used as a direct replacement for the gms30c2132 , the gms30c2232 defau lts to 8 - bit mem3 width as the gms30c2132 did. bootw is tied low internally for the GMS30C2216 processor, the bootb pin can then be used to select between 8 - bit and 16 - bit mem3 bus width. 6 . 1 . 2 sram and rom bus access on a one - cycle sram or eprom read access, the output enable signal oe# is switched to low during the second half of the access cycle; on a multi - cycle read access, oe# is switched to low after the first access cycle and remains low through the rest of the specified access cycles. on a sram write access, the write enable signals we0#..we3# corresponding to the bytes to be written are switched to low analogous to the oe# signal for single and multiple access cycles. for memory area mem 2, an address setup cycle preceding the access cycles can be specified. for mem0..mem3, bus hold cycles can be specified. bus hold cycles are additional cycles succeeding the access cycles where neither oe# nor we0#..we3# is low but all other bus signals a re asserted. the bus hold cycles can be specified to be skipped or enforced. (see section 6.4.7. memx bus hold break ).
bus int erface 6 - 9 6 . 1 . 3 dram bus access a dram access to the same dram page as addressed by the previous dram access is executed as fast page mode access. see bus control register bcr(17..16) for the access time and low - cycles of the casx# signals. cas0#..cas3# signals enable the corresponding memory bytes 0..3. a ras access occurs when the dram page is different from the previously accessed dram page. the ras# signal is switched to high for the number of specified precharge cycles. the high - order row address bits are multiplexed to the bit positions of the low - order column address bits according to the specified page size after the first bus cycle until the end of the specified ras - to - cas delay cycles. after the ras - to - cas delay cycles, the column address bits are available on the low - order bit positions and the cas access cycle begins. the row ad dress bits are available at the high - order bit positions for the whole dram access. after a dram access, the addressed dram page is being available for fast page mode accesses to the same page until either a new dram page is addressed, the processor is rel eased to another bus master for dma or a dram refresh takes place. note: the multiplexed row address bits are not in any specific order. dram read and write cycle (1) write cycle active word line ? tr: on ? load stored data to bit line ? data write (2) read cycle apply v dd /2 to bit line ? active word line ? read data stored in capacitor (3) refresh (cas before ras) cas before ras signal ? enter refresh mode ? store original data to sense amplifier ? active word line ? refresh (data write) word line (row address line) pass transister capacitor bit line (column address line)
6 - 10 chapter 6 6 . 1 . 3 . 1 dram row address bits multiplexing table 8.3 shows the dram row address bits multiplexing. the page size code is specified in the bus control register bcr. the gray fields denote the multiplexed dram row address bits. the white fields denote the dr am row address bits that are not multiplexed. address bus bits 31..16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 page size code dram row address bits 0 (000 2 ) 31..16 29 27 25 23 21 19 17 28 26 24 22 20 18 16 - - 1 (001 2 ) 31..16 15 27 25 23 21 19 17 16 26 24 22 20 18 16 28 29 2 (010 2 ) 31..16 15 14 25 23 21 19 17 15 14 24 22 20 18 16 26 27 3 (011 2 ) 31..16 15 14 13 23 21 19 17 15 14 13 22 20 18 16 24 25 4 (100 2 ) 31..16 15 14 13 12 21 19 17 15 14 13 12 20 18 1 6 22 23 5 (101 2 ) 31..16 15 14 13 12 11 19 17 15 14 13 12 11 18 16 20 21 6 (110 2 ) 31..16 15 14 13 12 11 10 17 15 14 13 12 11 10 16 18 19 7 (111 2 ) 31..16 15 14 13 12 11 10 9 16 14 13 12 11 10 9 16 17 tabl e 6 . 3 : dram row addre ss bits multiplexing note: dram can only be connected to memory area mem0. the address bit a0 of the address bus is not used in case of a 16 - bit bus size for memory area mem0. the address bits a1 and a0 of the address bus are not used in case of a 32 - bit b us size for memory area mem0. in case of page size code 0, only a 32 - bit bus size for memory area mem0 can be used. memory area mem0 is only selected, if address bits a31 and a30 of a memory address are zero.
bus int erface 6 - 11 6 . 2 i/o bus access the bus timing for an i/o access is specified by bits 1 1 ..3 of the i/o address. on an i/o access, the i/o read strobe iord# or the i/o write strobe iowr# is switched low for a read or write access respectively after the firs t access cycle and remains low for the rest of the specified access cycles. the beginning of the iord# or iowr# signal can be delayed by more than one cycle by specifying additional address setup cycles preceding the access cycles. the beginning of the nex t bus access can be delayed by specifying bus hold cycles succeeding the access cycles. bus hold cycles are required by many i/o devices due to the time required to switch from driving the data bus to three states. bit 11 of the i/o address enables a wait - pin controlled i/o access. the int3/wait input of the processor is sampled after the first three access cycles of the specified i/o access time. the i/o access will be extended by inserting further access cycles as long as the sig - nal at the wait input is asserted. when the wait signal becomes deasserted, the access will be terminated. note that there is latency of about 2..3 processor cycles until a signal change at the wait input becomes effective. the polarity of the wait signal can be programmed via bit 26 of the function control register fc r. when fcr(26) is set to 1 (default after reset), the wait signal is high asserted; when fcr(26) is set to 0, the wait signal is low asserted. a minimum of four i/o access cycles must be specified when the i/o wait m ode is being enabled. when an i/o device requires r/w# direction and data strobe control, iord# can be specified (by address bit 10 = 1) as data strobe. we# is then used as r/w# signal. ?? res erved 11 10 9 8 7 6 5 4 3 2 1 0 i/o address wait enable peri. device control mode 0=iord#/iowr# 1 =r/w#/data strobe control address set - up time 00=0 cycle 01=2 cycle 10=4 cycle 11=8 cycle access time 000=2 cycle 001=4 cycle 010=6 cycle 011= 8 cycle 100=10 cycle 101=12 cycle 110=14 cycle 111=16 cycle bus hold time after read/write access 00 = none 01 = 2 cycle 10 = 4 cycle 11 = 6 cycle
6 - 12 chapter 6 6 . 2 . 1 i /o bus control wit h i/o addresses, address setup, access and bus hold time can be specified by bits in the i/o address as follows: 0 2 3 4 5 7 8 9 10 reserved (must be 0) address setup time before read or write access 00 = 0 cycles 01 = 2 cycles 10 = 4 cycles 11 = 6 cycles access time for read or write access 000 = 2 cycles 001 = 4 cycles 010 = 6 cycles 011 = 8 cycles 100 = 10 cycles 101 = 12 cycles 110 = 14 cycles 111 = 16 cycles bus hold time after read or write access 00 = 0 cycles 01 = 2 cycles 10 = 4 cycles 11 = 6 cycles reserved for system peripheral 11 peripheral device control mode 0 = iord# / iowr# strobe control 1 = r/w# / data strobe control 21 25 i/o address and/or i/o chip select gms30c2 2 16: 6 bits gms30c2 2 32: 10 bits 12 13 wait enable reserved for internal use (must be 0) i/o register address 15 figure 6 . 1 : i/o bus control reserved bits must always be supplied as zero when speci fying an i/o address in a program.
bus int erface 6 - 13 6 . 3 bus control register bcr global register g20 is the write - only bus control register bcr. the bcr defines the parameters (bus timing, refresh control, page fault and par ity error disable) for accessing external memory located in address spaces mem0..mem3. all bits of the bcr are set to one on reset. they are intended to be initialized according to the hardware environment. bits name description 31 ..28 mem3access access t ime for address space mem3 1111 = 16 clock cycles 1110 = 15 clock cycles 1101 = 14 clock cycles 1100 = 13 clock cycles 1011 = 12 clock cycles 1010 = 11 clock cycles 1001 = 10 clock cycles 1000 = 9 clock cycles 0111 = 8 clock cycles 0110 = 7 clock cycles 01 01 = 6 clock cycles 0100 = 5 clock cycles 0011 = 4 clock cycles 0010 = 3 clock cycles 0001 = 2 clock cycles 0000 = 1 clock cycle 27..24 mem 2 access access time for address space mem 2 1111 = 16 clock cycles 1110 = 15 clock cycles 1101 = 14 clock cycles 1100 = 13 clock cycles 1011 = 12 clock cycles 1010 = 11 clock cycles 1001 = 10 clock cycles 1000 = 9 clock cycles 0111 = 8 clock cycles 0110 = 7 clock cycles 0101 = 6 clock cycles 0100 = 5 clock cycles 0011 = 4 clock cycles 0010 = 3 clock cycles 0001 = 2 clock cycles 0000 = 1 clock cycle 23 mem 1 hold bus hold time code for address space mem 1 when bcr(22) = 1: 1 = 2 clock cycles 0 = 1 clock cycle when bcr(22) = 0 1 = 1 clock cycle 0 = 0 clock cycles
6 - 14 chapter 6 bits name description 22..20 mem 1 access access time for a ddress space mem 1 111 = 8 clock cycles 110 = 7 clock cycles 101 = 6 clock cycles 100 = 5 clock cycles 011 = 4 clock cycles 010 = 3 clock cycles 001 = 2 clock cycles 000 = 1 clock cycle mem0 = non - dram (mcr(21) = 1): 19.. 16 mem1access access time for addr ess space mem 0 1111 = 16 clock cycles 1110 = 15 clock cycles 1101 = 14 clock cycles 1100 = 13 clock cycles 1011 = 12 clock cycles 1010 = 11 clock cycles 1001 = 10 clock cycles 1000 = 9 clock cycles 0111 = 8 clock cycles 0110 = 7 clock cycles 0101 = 6 clock cycles 0100 = 5 clock cycles 0011 = 4 clock cycles 0010 = 3 clock cycles 0001 = 2 clock cycles 0000 = 1 clock cycle 14 mem 0 setup address setup time for address space mem 0 11 = 3 clock cycles 10 = 2 clock cycles 01 = 1 clock cycle 00 = 0 clock cycle s 13. .1 1 mem0hold address setup time for address apace mem0 111 = 7 clock cycles 11 0 = 6 clock cycles 1 0 1 = 5 clock cycles 1 00 = 4 clock cycles 0 11 = 3 clock cycles 0 1 0 = 2 clock cycles 00 1 = 1 clock cycles 000 = 0 clock cycles mem0 = non - dram (mcr(21) = 0): 19..18 rasprecharge ras precharge time for address space mem0 when mcr(8)=0 when mcr(8)=1 11 = 4 clock cycles 6 clock cycle s 10 = 3 clock cycles 5 clock cycle s 01 = 2 clock cycles 4 clock cycle s 00 = 1 clock cycle 3 clock cycle s
bus int erface 6 - 15 bits name descript ion 17..16 casaccess cas access time for address space mem0 when mcr(8)=0 when mcr(8)=1 11 = 4 clock cycles 6 clock cycle s 10 = 3 clock cycles 5 clock cycle s 01 = 2 clock cycles 4 clock cycle s 00 = 1 clock cycle 3 clock cycle s 15..14 rastocas ras to cas delay time 11 = 4 clock cycles 10 = 3 clock cycles 01 = 2 clock cycle s 00 = 1 clock cycle 13..11 refreshselect refresh rate select (cas before ras refresh) 111 = refresh disabled 110 = refresh every 4 prescaler time units 1 01 = refresh every 8 prescal er time units 1 00 = refresh every 16 prescaler time units 0 11 = refresh every 32 prescaler time units 0 10 = refresh every 64 prescaler time units 0 0 1 = refresh every 128 prescaler time units 000 = refresh every 256 prescaler time units 10..8 mem3hold bus hold time code for address space mem3 111 = 7 clock cycles 11 0 = 6 clock cycles 1 01 = 5 clock cycles 1 00 = 4 clock cycles 0 11 = 3 clock cycles 0 1 0 = 2 clock cycles 00 1 = 1 clock cycle 000 = 0 clock cycles 7 mem3setup address setup time for address space m em3 1 = 1 clock cycle 0 = 0 clock cycles 6..4 pagesizecode page size code 3 mem2setup address setup time for address space mem2 1 = 1 clock cycle 0 = 0 clock cycles 2..0 mem2hold bus hold time code for address space mem 2 111 = 7 clock cycles 11 0 = 6 clo ck cycles 1 01 = 5 clock cycles 1 00 = 4 clock cycles 0 11 = 3 clock cycles 0 1 0 = 2 clock cycles 00 1 = 1 clock cycle 000 = 0 clock cycles table 6 . 4 : bus control register bcr
6 - 16 chapter 6 the dram type used and the physical page size of the d ram are specified by bits 6..4, in the bcr. table 8.5 shows the encoding of bcr(6..4) and the associated column address ranges for memory areas with bus sizes of 32, 16 and 8 bits. columns address range bcr(6..4) 32 - bit bus size 16 - bit bus size 8 - bit bus size 000 a15..a2 a15..a1 a15..a0 001 a14..a2 a14..a1 a14..a0 010 a13..a2 a13..a1 a13..a0 011 a12..a2 a12..a1 a12..a0 100 a11..a2 a11..a1 a11..a0 101 a10..a2 a10..a1 a10..a0 110 a9..a2 a9..a1 a9..a0 111 a8..a2 a8..a1 a8..a0 table 6 . 5 : column address ranges
bus int erface 6 - 17 6 . 4 memory control register mcr global register g27 is the write - only memory control register mcr. the mcr controls additional parameters for the external memory, the i nternal memory refresh rate, the mapping of the entry table and the processor power management. all bits of the mcr are set to one on reset except for the mem3bussize bits that are initialized from the bootw and bootb pads. the mcr bits must be initialized according to the hard ware environment and the desired function. bits name description 31 mem3paritydisable parity check disable for address space mem3 1 = disabled 0 = enabled 30 mem2paritydisable parity check disable for address space mem2 1 = disable d 0 = enabled 29 mem1paritydisable parity check disable for address space mem1 1 = disabled 0 = enabled 28 mem0paritydisable parity check disable for address space mem0 1 = disabled 0 = enabled 27 reserved 26 mem2waitdisable wait signal disable for ad dress space mem2 1 = disabled 0 = enabled 25 reserved 24 reserved 23 mem2bytemode byte write access mode for address space mem2 1 = we0# .. we3# act as byte write strobe 0 = we0# .. we3# act as byte enable signal 22 reserved for internal use 21 mem 0memorytype 1 = non - dram 0 = dram 20 iramrefreshtest 1 = normal mode 0 = test mode 19 mem1bytemode byte write access mode for address space mem1 1 = we0# .. we3# act as byte write strobe 0 = we0# .. we3# act as byte enable signal 18..16 iramrefreshrate 11 1 = disabled 110 = refresh every 2 prescaler time units (recommended) 101 = refresh every 4 prescaler time units 10 0 = refresh every 8 prescaler time units 0 1 1 = refresh every 16 prescaler time units 01 0 = refresh every 32 prescaler time units 00 1 = refr esh every 64 prescaler time units 000 = refresh every 128 prescaler time units
6 - 18 chapter 6 bits name description mem0 = non - dram (mcr(21) = 1): 15 mem0bytemode byte write access mode for address space mem0 1 = we0# .. we3# act as byte write strobe 0 = we0# .. we3# act as byte enable signal mem0 = non - dram (mcr(21) = 0): 15 dramtype 1 = fast page mode drams 0 = edo drams 14..12 entrytablemap 111 = mem3 110 = reserved 101 = reserved 100 = reserved 011 = internal ram (iram) 010 = mem2 001 = mem1 000 = mem0 11 mem 3 busholdbrea k 1 = break disabled 0 = break enabled 10 mem2busholdbrea k 1 = break disabled 0 = break enabled 9 mem1busholdbrea k 1 = break disabled 0 = break enabled mem0 = non - dram (mcr(21) = 1): 8 mem0busholdbrea k 1 = break disabled 0 = break enabled m em0 = non - dram (mcr(21) = 0): 8 dram bushold 1 = break enabled, bus hold time 1 cycle 0 = break enabled , bus hold time 0 cycle 7..6 mem3bussize 11 = 8 bit 10 = 16 bit 01 = reserved 00 = 32 bit 5..4 mem2bussize 11 = 8 bit 10 = 16 bit 01 = reserved 00 = 32 bit 3..2 mem1bussize 11 = 8 bit 10 = 16 bit 01 = reserved 00 = 32 bit 1..0 mem0bussize 11 = 8 bit 10 = 16 bit 01 = reserved 00 = 32 bit table 6 . 6 : memory control register mc
bus int erface 6 - 19 6 . 4 . 1 memx parity disable bits 31..28 of the mcr control parity generation and parity check for each memory area. the default setting is parity check disables. the appropriate mcr bit must be cleared to enable the parity check for that memory area. 6 . 4 . 2 memx wait disable bit 26 of the mcr controls the wait pin function for the memory area mem2. the default setting is wait function disabled. the mcr bit must be cleared to enable the wait function for the mem2 memory a rea. when this function is enabled, the int2/wait input of the processor is used as wait pin. any mem2 memory access remains active as long as the signal at the wait input is asserted (the wait input is sampled after the first three access cycles of the me mory access). the access will be terminated after the wait input becomes disserted . whether the input is low - asserted or high - asserted can be programmed via bit 26 of the function control register fcr. a minimum access time of four cycles must be specified for a memory area with the wait function enabled. if the int3/wait input is used as wait pin, bit 30 of the fcr (int3mask) should be set to 1 so that no interrupts are generated on the assertion of wait. 6 . 4 . 3 m emx byte mode bit 23, 19, and 15 of the mcr control the byte write access mode for memory areas mem2, mem1, and mem0, respectively. the default setting is byte - write - strobe, meaning that the signals we0#..we3# are used as write strobe signals for writing t he appropriate data byte to the external memory. when the mcr bit is cleared, the signals we0#..we3# act as a byte enable signal and the general we# signal must be used for writing the data to the memory. note: most sram chips with 16 - bit or 32 - bit wide da ta interface require a single write - enable signal and dedicated enable signals for each byte. the setting memxbytemode = 0 is intended specifically for those types of memories. 6 . 4 . 4 power down bit 22 of the mcr controls the power - down mode. the default setting is processor active . to switch the processor to power - down mode mcr(22) must be cleared. the switch to power - down is initiated by a transition from mcr(22) = 1 to mcr(22) = 0; thus, mcr(22) must be restored to one for at least one cycle before a new switch to power - down mode can occur. in power - down mode, only the logic for the timer, io3control modes, interrupt and refresh is being clocked, all other clocks are disabled. the switch to power - down mode is del ayed until the memory pipeline is empty. the processor is activated temporarily for refresh and bus arbitration cycles and is switched back to processor active by any interrupt or on reset. note that mcr(22) is not switched back to one by an interrupt. 6 . 4 . 5 iram refresh test bit 20 of the mcr specifies the internal ram (iram) refresh test. the default setting is normal mode, mcr(20) = 0 specifies refresh test mode.
6 - 20 chapter 6 6 . 4 . 6 iram refresh rate bits 18..16 of the mcr specify the iram refresh rate in number ( 4 .. 256 ) of prescaler time units. the default setting is disabled. recommended refresh rate for normal iram usage is every 2 prescaler time units. 6 . 4 . 7 dram type when the mem0 memory type is set to dram (mcr(21)=0), bit 15 of the mcr acts as control bit for selecting the dram type. the default setting is fast - page - mode dram. to support edo drams, mcr(15) must be cleared. when th e dram type indicates fast - page - mode drams, the oe# signal of the processor is left disserted during dram accesses. the oe# pin of the drams must then be tied low for correct dram operation. when the dram type indicates edo drams, oe# must be connected to the drams and is asserted on dram read accesses. oe# stays active for one half clock cycle past the end of the cas# signals, the read data is sampled at the end of oe#. thus, the processor can take advantage of the edo fracture . 6 . 4 . 8 entry table map bits 14..12 of the mcr map the entry table t o one of the memory areas mem0..mem3 or to the iram. with a mapping to mem3 (default setting), the entry table is mapped to the end of mem3, with all other settings, the ent ry table is mapped to the beginning of the specified memory area. 6 . 4 . 9 memx bus hold break bits 11..8 specify a memory bus hold break for mem3..mem0 respectively. the default setting is disabled . with enabled , b us hold cycles are skipped when the next memory access addresses the same memory area. regularly, the bus hold break should be enabled ; it must only be left disabled to accom m odate (rare) srams or roms which need all specified cycles before a new access ca n be started (e.g. for charge restore). if the mem0 memory type is dram, bit 8 changes the rasprecharge and casaccess cycle counts specified in bcr, and specifies a bus hold time of 0 or 1 cycle. bus hold break for dram is always enabled. 6 . 4 . 10 memx bus size bits 7..0 specify the bus size for each of the four memory areas
bus int erface 6 - 21 6 . 5 input status register isr global register g25 is the read - only input status register isr. the isr reflects the input levels at the pins io1..io3 as well as the input levels at the four interrupt pins int1..int4 and contains the eventflag , the equalflag , the watchdogflag and the clockonflag. re - served bits are read as . the input levels are not a ffected by the polarity bits in the function control register fcr, they reflect always the true signal level at the corresponding pins with a latency of 2..3 cycles, a 1 signals high level. bits name description 31.. 11 reserved 10 clockonflag determine s the source of the last reset event 1 = last reset caused by a clock - down command 0 = last reset caused by reset# signal or watchdog timer 9 watchdogflag determines the source of the last reset event 1 = last reset caused by watchdog timer (io3 timer) 0 = last reset caused by reset# signal or clock - down command 8 eventflag set to 1 in io3timing mode when io3level is equal to io3polarity cleared to 0 by fcr(13) = 1 or write to the wcr 7 equalflag set to 1 in io3timing or io3timerinterrupt mode when wcr(1 5..0) = tr(15..0) cleared to 0 by fcr(13) = 1 or write to the wcr 6 io3level reflects the signal level at the io3 pin 1 = high level 0 = low level 5 io2level reflects the signal level at the io2 pin 1 = high level 0 = low level 4 io1level reflects the s ignal level at the io1 pin 1 = high level 0 = low level 3 int4level reflects the signal level of interrupt input int4 1 = high level 0 = low level 2 int3level reflects the signal level of interrupt input int3 1 = high level 0 = low level 1 int2level ref lects the signal level of interrupt input int2 1 = high level 0 = low level 0 int1level reflects the signal level of interrupt input int1 1 = high level 0 = low level table 6 . 7 : input status register isr
6 - 22 chapter 6 6 . 6 function control register fcr global register g26 is the write - only function control register fcr. the fcr controls the polarity and function of the i/o pins io1..io3 and the interrupt pins int1..int4, the timer interrupt mas k and priority, the bus lock , the clkout pin and the extended overflow exception. all bits of the fcr are set to one on reset exception (from the reset# pin or as a result of a watchdog overrun). they must be initialized according to the hardware environme nt and the desired function. the reserved bits must not be changed when the fcr is updated. the fcr is preserved on a clock - down reset in order to have the correct interrupt mask and polarity for the wakeup from clock - down. each of the four interrupt pins int1..int4 can cause a processor interrupt when the corresponding interrupt mask bit is cleared. the corresponding polarity bit determines whether the signal at the interrupt pin must be low (polarity bit = 0) or high (polarity bit = 1) to cause an interru pt. additionally, the internal timer interrupt can be enabled or disabled separately. each of the i/o pins io1..io3 can be either used as input or interrupt signal (ioxdirection = 1) or as output (ioxdirection = 0). the clkout pin of the processor can be p ro - grammed to provide a static output level of either high or low, or it can be configured to provide the processor ? s internal clock signal undivided or divided by two or four. bits name description 31 int4mask 1 = interrupt int4 disabled 0 = interrupt in t4 enabled 30 int3mask 1 = interrupt int3 disabled 0 = interrupt int3 enabled 29 int2mask 1 = interrupt int2 disabled 0 = interrupt int2 enabled 28 int1mask 1 = interrupt int1 disabled 0 = interrupt int1 enabled 27 int4polarity 1 = non - inverted (interr upt on high level) 0 = inverted (interrupt on low level) 26 int3polarity 1 = non - inverted (interrupt on high level) 0 = inverted (interrupt on low level) 25 int2polarity 1 = non - inverted (interrupt on high level) 0 = inverted (interrupt on low level) 24 int1polarity 1 = non - inverted (interrupt on high level) 0 = inverted (interrupt on low level) 23 tintdisable 1 = timer interrupt disabled 0 = timer interrupt enabled 22 clkoutpolarity 1 = inverted / high 0 = non - inverted / low 21..20 timerpriority 11 = priority 6 (higher than priority of int1) 10 = priority 8 (higher than priority of int2) 01 = priority 10 (higher than priority of int3) 00 = priority 12 (higher than priority of int4)
bus int erface 6 - 23 bits name description 19..18 clickoutcontrol 11 = output reflects clkoutpolarity 10 = processor clock 01 = processor clock / 2 00 = processor clock / 4 17 buslock dma access 1 = non - locked 0 = locked out 16 eovdisable extended overflow exception: 1 = disabled 0 = enabled 15..14 reserved 13..12 io3control io3 contr ol state: 11 = io3standard mode 10 = watchdog mode 01 = io3timing mode 00 = io3timerinterrupt mode 11 reserved 10 io3direction 1 = input 0 = output 9 io3polarity 1 = non - inverted 0 = inverted 8 io3mask on input: 1 = io3 interrupt disabled 0 = io3 int errupt enabled on output: 1 = io3 output reflects io3polarity 0 = reserved 7 reserved 6 io2direction 1 = input 0 = output 5 io2polarity 1 = non - inverted 0 = inverted 4 io2mask on input: 1 = io2 interrupt disabled 0 = io2 interrupt enabled on output: 1 = io2 output reflects io2polarity 0 = reserved 3 reserved 2 io1direction 1 = input 0 = output 1 io1polarity 1 = non - inverted 0 = inverted 0 io1mask on input: 1 = io1 interrupt disabled 0 = io1 interrupt enabled on output: 1 = io1 output reflects io1polarity 0 = output reflects supervisor flag xor not io1polarity table 6 . 8 : function control register fcr
6 - 24 chapter 6 6 . 7 watchdog compare register wcr global register g24 is the watch dog compare register wcr. only bits 15..0 are used, bits 31..16 are reserved, they must be zero on a move to the wcr. in the present version, bits 31..16 are read as zero. the wcr is used by the io3 control modes (see section 6.8. io3 control modes ). 6 . 8 io3 control modes additionally to the standard use like io1 and io2 (see section 6 .9.3. bus signal description ), there are special control modes in combination with the io3 pin. these control modes are specified by fcr(13) and fcr(12). on all io3 control modes, the watchdog compare register wcr must be set before the control mode is specified in the fcr, otherwise the equalflag could be set erroneously. the equalflag and the eventflag are being cleared on all io3 control modes by either setting fcr(13) to one or a move to the watchdog compare register wcr. 6 . 8 . 1 io3standard mode fcr(13) = 1, fcr(12) = 1 specifies io3standard mode. sta ndard use of io3 without any additional io3 control functions. see section 6.9.3. for signals io1..io3 . 6 . 8 . 2 watchdog mode fcr(13) = 1, fcr(12) = 0 specifies watchdog mode. a reset exception occurs when wcr(15..0) = tr(15..0). the standard use of io3 is not affected. tr wcr x reset exception tpr processor clock frequency timer clock frequency carry compare note: the wcr must be set before the io3 control mode is determined by fcr(13..12) as watchdog mode.
bus int erface 6 - 25 6 . 8 . 3 io3ti ming mode fcr(13) = 0, fcr(12) = 1 specifies the io3timing mode. on io3direction = input: when input signal io3level = io3polarity, the eventflag isr(8) is set and the current contents of the tr(15..0) is copied to the wcr. thus, the time of the event indi cated by the 16 low - order bits of the tr is captured in the wcr. when wcr(15..0) = tr(15..0) before the eventflag is set, the equalflag isr(7) is set. either flag set causes an interrupt when the io3 interrupt is enabled. note: the eventflag and the equalf lag can be used to distinguish between an input signal transition and a timeout. the eventflag can be set even after the equalflag (but not vice versa) during the interrupt latency time; thus, when the eventflag is set, wcr(15..0) contains always the time when the input reached the level specified by io3polarity. note that the eventflag is immediately set on entering io3timing mode when the input signal is already on the specified level. wcr(15..0) must be set on a value different from the value of the tr(1 5..0), otherwise the equalflag is set immediately. the maximum span for the timeout is 2 16 - 1 ticks of the tr. io3direction = output: when wcr(15..0) = tr(15..0), the equalflag is set and an interrupt occurs when the io3 interrupt is enabled. additionally, an internal toggle latch is toggled. the io3 output signal is high when the value of the toggle latch and io3polarity are not equal, otherwise low. thus, each toggling causes a transition of the io3 output signal. the toggle latch is cleared by setting fcr (13) to 1. note: this mode can be used to create an arbitrary output signal sequence by just updating the wcr. when the program switches to io3standard mode after the end of a signal sequence and the toggle latch remained set to 1, fcr(13) must be set to 1 and io3polarity be inverted coincidentally in the same move to fcr to avoid a transition of the io3 output signal. the io3 interrupt must also be disabled in the same move to fcr to avoid an interrupt from the output signal. 6 . 8 . 4 io3timerinterrupt mode fcr(13) = 0, fcr(12) = 0 specifies the io3timerinterrupt mode. additionally to the standard use of io3, the condition wcr(15..0) = tr(15..0) sets the equalflag isr(7) and causes an io3 interrupt regardless of the io3mask in fcr(8) (io3 interrupt disable). note: when the io3 interrupt is disabled, the io3timerinterrupt mode can be used independently of the use of io3 as input or output. when the io3 interrupt is enabled, the io3timerinterrupt mode can be used as a timeout for the io3 interrupt. the equalflag can then be used to distinguish between timeout and an io3 interrupt.
6 - 26 chapter 6 6 . 9 bus signals 6 . 9 . 1 bus signals for the gms30c2 2 32 processor the following table is an overview of the bus signals of the gms30c2 2 32 microprocessor. for a detailed description of the function of the bus signals refer to section 6 .9.3. bus signal desc ription . the signal states are defined as i = input, o = output and z = three - state (inactive). states pin count signal name description i 1 xtal1/clkin external crystal, optionally clock input o 1 xtal2 external crystal o 1 clkout clock output o/z 26 a25..a0 address bus o/i 32 d31..d0 data bus o/i 4 dp0..dp3 parity bits o/z 1 ras# dram ras signal / chip select for mem0 o/z 4 cas0#..cas3# dram cas signal for bytes 0..3 o/z 1 we# write enable for dram and r/w# for i/o o/z 3 cs1#..cs3# chip select f or mem1..mem3 o/z 4 we0#..we3# write enable /byte enable for sram bytes 0..3 o/z 1 oe# output enable for srams , eproms , edo drams o/z 1 iord# i/o read strobe, optionally i/o data strobe o/z 1 iowr# i/o write strobe o 1 rqst bus request output i 1 gran t# bus grant input o 1 act active as bus master i 3 int1.. int2, int4 interrupt inputs i 1 int 3/wait interrupt input or wait input o/i 3 io1..io3 programmable input / output i 2 bootw, bootb boot bus width selection inputs for mem3 i 1 reset# reset in put 16 nc no connect (not for gms30c2232 - 144tqfp) 26 vdd power supply voltage 26 gnd ground total: 160 (144 for gms30c2 2 32 - 144tqfp) table 6 . 9 : bus signals for the gms30c2 2 32 processor
bus int erface 6 - 27 6 . 9 . 2 bus signals for the gms30c2 2 16 processor the following table is an overview to the bus signals of the gms30c2 2 16 microprocessor. for detailed description of the function of the bus signals refer to section 6 .9.3. bus signal description . the signal states are defined as i = input, o = output and z = three - state (inactive). states pin count signal - names description i 1 xtal1/clkin external crystal, optionally clock input o 1 xtal2 external crystal o 1 clkou t clock output o/z 22 a21..a0 address bus o/i 16 d15..d0 data bus o/i 2 dp0..dp1 parity bits o/z 1 ras# dram ras signal / chip select for mem0 o/z 2 cas0#..cas1# dram cas signal for bytes 0..1 / 2..3 o/z 1 we# write enable o/z 3 cs1#..cs3# chip sele ct for mem1..mem3 o/z 2 we0#..we1# write enable /byte enable for sram bytes 0..1 / 2..3 o/z 1 oe# output enable for srams , eproms , edo drams o/z 1 iord# i/o read strobe, optionally i/o data strobe o/z 1 iowr# i/o write strobe o 1 rqst bus request outpu t i 1 grant# bus grant input o 1 act active as bus master i 3 int1.. int2, int4 interrupt inputs i 1 int 3/wait interrupt input or wait input o/i 3 io1..io3 programmable input / output i 1 bootb boot bus width selection input for mem3 i 1 reset# reset input 16 vdd power supply voltage 18 gnd ground total: 100 table 6 . 10 : bus signals for the gms30c2 2 16 processor
6 - 28 chapter 6 6 . 9 . 3 bus signal description the following section describes the bus signals for both the gms30c2232 and GMS30C2216 microprocessor in detail. in the following signal description, the signal states are defined as i = input, o = output and z = three - state (inactive). states names use i xtal1/clkin i nput for quartz crystal. when the clock is generated by an external clock generator, xtal1 is used as clock input. the clock signal is multiplied by four and divided according to the tpr setting to generate the internal clock. o xtal2 output for quartz cry stal. xtal2 is not connected when an external clock generator is used. o clkout clock signal output or programmable output . clkout can be selected as a programmable output pin or as output delivering the cpu clock signal divided by 1, 2 or 4. clkout can be used to supply a clock signal to peripheral devices. o/z a25..a0 the address bits a25..a0 represent the address bus. an active high bit signals a "one". a0 is the least significant bit. with the e1 - 16 , only a2 1 ..a0 are connected to the address bus pins. o/i d31..d0 data bus. the signals d31..d0 (d15..d0 with the GMS30C2216 ) represent the bidirectional data bus; active high signals a "one". at a read access, data is transferred from the data bus to the register set or to the instruction cache only at the c ycle corresponding to the last actual read access cycle, thus inhibiting garbled data from being transferred. at a write access, the data bus signals are activated during the address setup, write and bus hold cycle(s). a halfword or byte to be written is m ultiplexed from its right - adjusted position in a register to the addressed half word or byte position. thus, no external multiplexing of data signals is required. on a 32 - bit wide memory area, byte addresses 0, 1, 2 and 3 correspond to d31..d24, d23..d16, d15..d8 and d7..d0 respectively (big endian). on a 16 - bit wide memory area, byte address 2 and 3 in the first access and byte addresses 0 and 1 in the second access correspond to d15..d8 and d7..d0 respectively. on a 8 - bit wide memory area, byte addresses 3..0 correspond to d7..d0 in succeeding accesses.
bus int erface 6 - 29 states names use o/i dp0..dp3 data parity signals. dp0..dp3 represent the bidirectional parity signals; active high indicates a "one". with the gms30c2232 , dp0, dp1, dp2 and dp3 correspond to d31..d24, d23 ..d16, d15..d8 and d7..d0 respectively. with the GMS30C2216 , dp0 and dp1 correspond to d15..d8 and d7..d0 respectively. at a write access, all data parity signals are activated during the address setup, write and bus hold cycles. at a read access, the corr esponding data parity signals are evaluated at the last read access cycle when parity checking for the addressed memory area is enabled. parity "odd" is used, that is, the correct parity bit is "one" when all bits of the corresponding byte are "zero". o/z ras# row address strobe. active low indicates row ad dress strobe asserted. ras# is activated high and then again low when the pro cessor accesses a new page in the dram address space, that is when any of the (high order) ras address bits is different from the ras address bits of the last dram ac cess. ras# is left low after any own dram access. ras# is activated high, low and then high by a refresh cycle. when the bus is granted to another bus master, the processor starts the next dram access as a ras acce ss. at any non - ras address cycle, ras# is left unchanged, thus, a previously selected dram page is not affected. when non - dram memory is placed in memory area mem0, ras# is used as the chip select signal for this memory. o/z cas0#..cas3# column address str obe. active low indicates column address strobe asserted. cas0#..cas3# are only used by a dram for column access cycles and for "cas before ras" refresh. with the gms30c2232 , cas0#..cas3# correspond to the column address enable signals for d31..d24, d23..d 16, d15..d8 and d7..d0 respectively. with the gms30c2 2 16 , cas0# and cas1# correspond to the column address enable signals for d15..d8 and d7..d0 respectively. o/z we# write enable. we# is signaled in the same cycle(s) as address signals. active low indicat es a write access, active high indicates a read access. we# is intended to be used as dram write enable and as r/w# for i/o access when iord# is specified as data strobe (see iord#). note: we# can also be used to control bus transceivers when peripheral de vices or slow memories must be separated from the processor data bus in order to decrease the capacitive load of the processor data bus.
6 - 30 chapter 6 states names use o/z cs1#..cs3# chip select. chip select is signaled in the same cycle(s) as the address signals. acti ve low of cs1#..cs3# indicates chip select for the memory areas mem1..mem3 respectively. note: ras# is used as chip select for a non - dram memory in mem0. o/z we0#/be0# sram write enable. active low indicates write enable for the .. we 3 #/be 3 # c orresponding byte, active high indi cates write disable. w hen the byte mode for the corresponding memory area is enabled, we0#..we3# are used as byte enables be0#..be3#; low indicates enable, high indicates disable. the we# signal is then used as write enable signals . with the gms30c2232, we0#..we3# correspond to the enable signals for d31..d24, d23..d16, d15..d8 and d7..d0 respectively. with the gms30c2 2 16 , we0# and we1# correspond to the enable signals for d15..d8 and d7..d0 respectively. o/z oe# output enable for sr ams , eproms and edo drams . oe# is active low on a sram , eprom or edo dram read access. o/z iord# i/o read strobe, optionally i/o data strobe. the use of iord# is specified in the i/o address. bit 10 = 0 specifies i/o read strobe, bit 10 = 1 specifies i/o d ata strobe. when specified as i/o read strobe, iord# is low on i/o read access cycles, high on all other cycles. when specified as i/o data strobe, iord# is low on any i/o access cycles, high on all other cycles. note: when iord# is specified as i/o data s trobe, we# can be used as r/w# signal. o/z iowr# i/o write strobe. when specified as i/o writes strobe by i/o address bit 10 = 0, iowr# is active low on i/o write access cycles. o rqst rqst signals the request for a memory or i/o access. rqst is high from the beginning of the request until the requested access is completed. i grant # bus grant. grant# is signaled low by an (off - chip) bus arbiter to grant access to the bus for memory and i/o cycles. when grant# is switched from low to high during an access, t he bus is only released to another bus master after completion of the current access. the grant# signal supplied by a bus arbiter may be asynchronous to the clock; it is synchronized on - chip to avoid metastab le . for systems with a single bus master, grant# must be tied low. note: grant# is recommended to be kept low by the bus arbiter on the bus master with the last access; thus, any subsequent access by the same bus master saves the synchronization time.
bus int erface 6 - 31 states names use o act active as bus master. act is signaled high when grant# is low and it is kept high during a current bus access. since grant# is asynchronous, act follows grant# with a delay of 2..3 cycles. act is also kept high on a bus lock (fcr(17) = 0) from the beginning of the first access after fcr(17) is cleared to zero until the bus lock is released by setting fcr(17) to one. note: when act transits from high to low, the address and data bus are switched to three state (inactive). all bus control signals marked o/z are driven high and then swi tched to three state. these signals are kept high by an on - chip resistor (ca. 1 m w ) tied on - chip to vcc. i int1..int4 interrupt request. a signal of a specified level on any of the int1..int4 interrupt request pins causes an interrupt exception when the in terrupt lock flag l is zero and the corresponding intxmask bit in fcr is not set. the intxpolarity bits in fcr specify the level of the intx signals: intxpolarity = 1 causes an interrupt on a high input signal level, intxpolarity = 0 causes an interrupt on a low input signal level. int1..int4 may be signaled asynchronously to the clock; they are not stored internally. a transi tion of int1..int4 is effective after a minimum of three cycles. the response time may be much higher depending on the number of cyc les to the end of the current instruction or the number of cycles until the interrupt lock flag l is cleared. note: the signal level of int1..int4 can be inspected in isr(0)..isr(4). thus, with the corresponding intxmask bit set, int1..int4 can be used jus t as input signals. o/i io1..io3 general input - output. io1..io3 can be individually configured via ioxdirection bits in the fcr as either input or output pins. when configured as input, io1..io3 can be used like int1..int4 for additional interrupt or input signals. when configured as output, the ioxpolarity bit in fcr specifies the output signal level. ioxpolarity = 1 specifies a high level, ioxpolarity = 0 specifies a low level. io1 .. io 3 are always switched rail - to - rail regardless of the setting of mcr(25) . an output signal at io1 or io2 cannot cause an interrupt regardless of the corresponding ioxmask bit; however, it can be inspected as ioxlevel in isr (e.g. for testing). io3 can be used for various control functions. i reset # reset processor. reset# low resets the processor to the initial state and halts all activity. reset# must be low for at least two cycles. on a transition from low to high, a reset exception occurs and the processor starts execu tion at the reset entry . the transition may occur asynch ronously to the clock. o/z bootw , input pins for selecting the data bus width for boot memory area bootb mem3 (see section 6 .1.1. boot width selection) .
6 - 32 chapter 6 6 . 10 bus cycles 6 . 10 . 1 memx byte mode = 1 6 . 10 . 1 . 1 sram and rom single - cycle read access figure 6 . 2 : sram and rom single - cycle read access , memx byte mode = 1 6 . 10 . 1 . 2 sram single - cycle write access figure 6 . 3 : sram single - cycle write access , memx byte mode = 1 clk chip select address bus we# we0#..we3# data bus (read data) oe# addr. 1 addr. 2 addr. 3 addr. 4 addr. 5 data 1 data 2 data 3 data 4 data 5 clk chip select address bus we# we0#..we3# data bus oe# addr. 1 addr. 2 addr. 3 addr. 4 addr. 5 data 1 data 2 data 3 data 4 data 5
bus int erface 6 - 33 6 . 10 . 1 . 3 sram and rom multi - cycle read access figure 6 . 4 : sram and rom multi - cycle read access , memx byte mode = 1 6 . 10 . 1 . 4 sram multi - cycle write access figure 6 . 5 : sram multi - cycle write access , memx byte mode = 1 clk chip select address bus we# we0#..we3# data bus oe# address setup time 0..3 cycles access time 2..16 cycl es bus hold time 0..7 cycles address setup time 0..3 cycles access time 2..16 cycles bus hold time 0..7 cycles clk chip select address bus we# we0#..we3# data bus oe#
6 - 34 chapter 6 6 . 10 . 2 memx byte mode = 0 6 . 10 . 2 . 1 sram single - cycle read access figure 6 . 6 : sram single - cycle read access, memx byte mode = 0 6 . 10 . 2 . 2 sram single - cycle write access figure 6 . 7 : sram write - cycle read access, memx byte mode = 0 c lk c hip select address bus we# be0#..be3# data bus (read data) oe# addr. 1 addr. 2 addr. 3 addr. 4 addr. 5 data 1 data 2 data 3 data 4 data 5 clk chip select address bus we# be0#..be3# data bus oe# addr. 1 addr. 2 addr. 3 addr. 4 add r. 5 data 1 data 2 data 3 data 4 data 5
bus int erface 6 - 35 6 . 10 . 2 . 3 sram m ulti - cycle read access figure 6 . 8 : sram multi - cycle read access, memx byte mode = 0 6 . 10 . 2 . 4 sram multi - cycle write access figure 6 . 9 : sram multi - cycle write access , memx byte mode = 0 address setup time 0..3 cycles access time 2..16 bus hold time 0..7 cycles clk chip select address bus we# be0#..be3# data bus oe# clk chip select address bus we# be0#..be3# data bus oe# address setup time 0..3 cycles access time 2..16 bus hold time 0..7 cycles
6 - 36 chapter 6 6 . 10 . 3 mem2 read access with wait pin figure 6 . 10 : mem2 read access with wait pin note: arrows o n wait signal indicate the times where the signal is inspected. in this example s pecified access time: 4 cycles a ctual access time: 6 = 4 cycles + 2 additional cycles caused by wait pin clk chip select address bus we0#..we3# wait data bus oe# access time (minimum 4 cycle) next access or bus hold time if specified mem2 byte mode = 1, int3polarity = inverted, address setup time = 0 cycles, bus hold time = 0 c ycles
bus int erface 6 - 37 6 . 10 . 4 i/o read access clk chip select address bus we# iord# data bus access time 2 ..16 cycles address setup time 0 ..6 cycles bus hold time 0 .. 6 cycles figure 6 . 11 : i/o read access
6 - 38 chapter 6 6 . 10 . 5 i /o read access with wait pin figure 6 . 12 : i/o read access with wait pin note: arrows on wait signal indicate the times where the signal is inspected. in this example s pecified access time: 4 cycles a ctual access time: 6 = 4 cycles + 2 additional cycles caused by wait pin clk chip select address bus we # wait data bus oe# access time (minimum 4 cycle) next access or bus hold time if specified address setup time = 0 cycles, bus hold time = 0 cyc les, int3polarity =
bus int erface 6 - 39 6 . 10 . 6 i/o write access clk chip select address bus we# iord# data bus access time 2..16 cycles address setup time 0..6 cycles bus hold time 1..7 cycles iowr# figure 6 . 13 : i/o write access note: if iord# is used as i/o data strobe, iord# instead of iowr# is activated low.
6 - 40 chapter 6 6 . 10 . 7 dram 6 . 10 . 7 . 1 fast page mode dram access figure 6 . 14 : fast page mode dram access clk address bus high order bits address bus low order bits ras# cas0#..cas3# ras precharge time 1..6 cycles ras to cas delay time 1..6 cycles cas access time 1..6 cycles cas access time 1..6 cycles we# oe# data bus (read data) at read access we# oe# data bus (write data) at write access valid undefine row address col. addr. col. addr.
bus int erface 6 - 41 6 . 10 . 7 . 2 edo dram single - cycle access figure 6 . 15 : edo dram single - cycle access clk address bus high order bits address bus low order bits ras# cas0#..cas3# ras precharge time 1..6 cycles ras to cas delay time 1..6 cycles cas access time 1..6 cycles cas access time 1..6 cycles we# oe# data bus (read data) at read access we# oe# data bus (write data) at write access valid undefin row address col. addr. col. addr.
6 - 42 chapter 6 6 . 10 . 7 . 3 edo dram multi - cycle access figure 6 . 16 : edo dram multi -- cycle access clk address bus high order bits address bus low order bits ras# cas0#..cas3# cas access time 1..6 cycles cas access time 1..6 cycles ras to cas delay time 1..4 cycles ras access time 1..6 cycles we# oe# data bus (read data) at read access we# oe# data bus (write data) at write access valid undefin row addr. column address column address oe# is set after the first cycle of the cas access time
bus int erface 6 - 43 6 . 10 . 7 . 4 dram refresh (cas before ras refresh) clk address bus cas# ras to cas delay time 1..4 cycles ras precharge time 1..4 cycles cas access time 1.. 6 cycles ras# undefined figure 6 . 17 : dram refresh
6 - 44 chapter 6 6 . 11 dc characteristics absolute maximum ratings case temperature t c under bias: 0c to + 70 c extended temperature range on request storage temperat ure: - 65c to +150c voltage on any pin with respect to ground: - 0.5v to v cc + 0.5v d.c. parameters supply voltage v cc : 3.3v 0.30v case temperature t case : 0c to +85c symbol parameter min max unit notes vil input low voltage - 0.3 +0.8 v except clkin v ih input high voltage 2.0 5v+0.5 v except clkin vol output low voltage 0.45 v at 4 ? voh output high voltage 2.4 v at 4 ? ili input leakage current ?? 20 ? ilo output leakage current ?? 20 ? c clk clock capacitance 10 ? c adr output capacitance a12..a0 15 ? c i / o input/output capacitance all other signals 10 ? table 6 . 11 : dc characterist
mechanical data 7 - 1 7 . mechanical data 7 . 1 gms30c2 2 32, 160 - pin mqfp - package 7 . 1 . 1 pin configuration - view from top side 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 108 107 106 105 104 103 102 101 100 99 98 96 95 94 93 92 91 90 89 88 87 86 85 84 121 122 123 124 125 126 127 128 129 130 131 132 133 97 48 47 46 45 44 43 42 41 71 70 69 68 67 66 65 64 63 62 49 50 a24 a23 gnd vcc a22 a8 a7 vcc a6 a5 a4 gnd we0# /be0# we1# /be1# vcc cas0# a14 gnd vcc act a13 gnd we# gnd vcc vcc d23 d22 gnd d5 d4 d3 vcc d2 d1 d0 vcc gnd d21 d20 d19 dp2 dp3 vcc gnd reset# grant# vcc gnd vcc vcc gnd io3 iowr# cs3# cs2# cs1# gnd ras# a19 vcc a20 a21 gnd d31 d30 d29 a9 a10 a11 a12 vcc d28 d27 d26 gnd we2# /be2# iord# oe# vcc cas3# cas2# cas1# gnd xtal1/clkin xtal2 io2 vcc d16 d17 d18 a3 a2 a1 a0 gnd dp1 dp0 83 82 81 bootw clkout io1 gnd rqst int4 int3 /wait int2 int1 gnd vcc 61 60 59 58 57 56 55 54 53 52 51 vcc gnd d9 gnd d8 d7 vcc gnd d6 d24 26 27 28 29 30 31 32 33 34 35 36 gnd d25 d15 d14 vcc d13 d12 d11 d10 gnd vcc 134 135 136 137 138 139 140 141 142 143 144 vcc gnd bootb a18 a17 gnd vcc a16 a15 a25 gnd 72 gnd vcc we3# /be3# nc nc nc nc 109 110 111 112 113 114 115 116 117 118 119 120 73 74 75 76 77 78 79 80 nc nc nc nc 37 38 39 40 nc nc nc nc 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 nc nc nc nc gms30c2 2 32 figure 7 . 1 : gms30c2 2 32, 160 - pin mqfp - package
7 - 2 chapter 7 7 . 1 . 2 pin cross reference by pin name signal location signal location signal location signal location a0 ................... 97 d 3 ...................... 5 9 gnd .................. 50 nc ................... 118 a1 ................... 98 d 4 ...................... 5 8 gnd .................. 56 nc ................... 123 a2 ................... 99 d 5 ...................... 57 gnd .................. 65 nc ................... 124 a3 ................. 100 d 6 ...................... 51 gnd .................. 68 nc ................... 157 a4 ................. 137 d 7 ...................... 48 gnd .................. 73 nc ................... 158 a5 ................. 138 d 8 ...................... 47 gnd .................. 79 oe # ................ 113 a6 ................. 139 d 9 ...................... 45 gnd .................. 82 ras # ................ 11 a7 ................. 141 d 10 .................... 36 gnd .................. 90 reset # ............ 74 a8 ................. 142 d 11 .................... 35 gnd .................. 96 rqst ................ 89 a9 ................... 20 d 12 .................... 34 gnd ................ 108 vcc .................... 1 a10 ................. 21 d 13 .................... 33 gnd ................. 119 vcc .................. 13 a11 ................. 22 d 14 .................... 31 gnd ................ 122 vcc .................. 24 a12 ................. 23 d 15 .................... 30 gnd ................ 126 vcc .................. 32 a13 ............... 127 d 16 .................. 103 gnd ................ 130 vcc .................. 40 a14 ............... 131 d 17 .................. 102 gnd ................ 136 vcc .................. 41 a15 ............... 150 d 18 .................. 101 gnd ................ 145 vcc .................. 49 a16 ............... 151 d 19 .................... 69 gnd ................ 148 vcc .................. 53 a17 ............... 154 d 20 .................... 67 gnd ................ 153 vcc .................. 60 a18 ............... 155 d2 1 .................... 66 gnd ................ 159 vcc .................. 64 a19 ................. 12 d2 2 .................... 55 grant# ........... 75 vcc .................. 72 a20 ................. 14 d2 3 .................... 54 int1 .................. 85 vcc .................. 76 a21 ................. 15 d2 4 .................... 52 int2 .................. 86 vc c .................. 80 a22 ............... 143 d2 5 .................... 29 int3 /wait ........ 87 vcc .................. 81 a23 ............... 146 d2 6 .................... 27 int4 .................. 88 vcc ................ 104 a24 ............... 147 d2 7 .................... 26 io 1 .................... 91 vcc ................ 112 a25 ............... 149 d 28 .................... 25 io2 .................. 105 vcc ................ 120 act .............. 128 d 29 .................... 19 io3 ...................... 5 vcc ................ 121 bootb ......... 156 d 30 .................... 18 iord# .............. 114 vcc ................ 129 bootw .......... 93 d 31 .................... 17 iowr# ................ 6 vcc ................ 133 cas 0 # .......... 132 dp 0 ................... 94 nc ...................... 3 vcc ................ 14 0 cas 1 # .......... 109 dp 1 ................... 95 nc ...................... 4 vcc ................ 144 cas2# .......... 110 dp2 ................... 70 nc .................... 37 vcc ................ 152 cs s3 # .......... 111 dp3 ................... 71 nc .................... 38 vcc ................ 160 clkout ...... 92 gnd .................... 2 nc .................... 43 we# ................ 125 cs 1 # ................ 9 gnd .................. 10 nc .................... 44 we0# /be0# .... 135 cs2# ................ 8 gnd .................. 16 nc .................... 77 we1# /be1# .... 134 cs3# ................ 7 gnd .................. 28 nc .................... 78 we2# /be2# .... 115 d 0 ................... 63 gnd .................. 39 nc .................... 83 we3# /be3# .... 1 16 d 1 ................... 62 gnd .................. 42 nc .................... 84 xtal1/clkin . 107 d 2 ................... 61 gnd .................. 46 nc ................... 117 xtal2 ............. 106
mechanical data 7 - 3 7 . 1 . 3 pin cross reference by location location signal location signal location signal location signal 1 ....... vcc 41 ....... vcc 81 ....... vcc 1 21 ....... vcc 2 ....... gnd 42 ....... gnd 82 ....... gnd 122 ....... gnd 3 ....... nc 43 ....... nc 83 ....... nc 123 ....... nc 4 ....... nc 44 ....... nc 84 ....... nc 124 ....... nc 5 ....... io3 45 ....... d9 85 ....... int1 125 ....... we# 6 ....... iowr# 46 ....... gnd 86 ....... int2 126 ....... gnd 7 ....... cs3# 47 ....... d8 87 ....... int3 /wait 127 ....... a13 8 ....... cs2# 48 ....... d7 88 ....... int4 128 ....... act 9 ....... cs1# 49 ....... vcc 89 ....... rqst 129 ....... vcc 10 ....... gnd 50 ....... gn d 90 ....... gnd 130 ....... gnd 11 ....... ras# 51 ....... d6 91 ....... io1 131 ....... a14 12 ....... a19 52 ....... d24 92 ....... clkout 132 ....... cas0# 13 ....... vcc 53 ....... vcc 93 ....... bootw 133 ....... vcc 1 4 ....... a 20 5 4 ....... d2 3 94 ....... dp0 13 4 ....... we1#/be1# 1 5 ....... a 21 5 5 ....... d2 2 9 5 ....... dp1 13 5 ....... we0#/be0# 16 ....... gnd 56 ....... gnd 96 ....... gnd 136 ....... gnd 17 ....... d31 57 ....... d5 97 ....... a0 137 ....... a4 18 ....... d30 58 ....... d4 98 ....... a1 138 ....... a5 19 ....... d29 59 ....... d3 99 ....... a2 139 ....... a6 20 ....... a9 60 ....... vcc 100 ....... a3 140 ....... vcc 21 ....... a10 61 ....... d2 101 ....... d18 141 ....... a7 22 ....... a11 62 ....... d1 102 ....... d17 142 ....... a8 23 ....... a12 63 ....... d0 103 ....... d16 143 ....... a22 24 ....... vcc 64 ....... vcc 104 ....... vcc 144 ....... vcc 25 ....... d28 65 ....... gnd 105 ....... io2 145 ....... gnd 26 ....... d27 66 ....... d21 106 ....... xtal2 146 ....... a23 27 ....... d26 67 ....... d20 107 ....... xtal1/clkin 147 ....... a24 28 ....... gnd 68 ....... gnd 108 ....... gnd 148 ....... gnd 29 ....... d25 69 ....... d19 109 ....... cas1# 149 ....... a25 30 ....... d15 70 ....... dp2 110 ....... cas2# 150 ....... a15 31 ....... d14 71 ....... dp3 111 ....... cas3# 151 ....... a16 32 ....... vcc 72 ....... vcc 112 ....... vcc 152 ....... vcc 33 ....... d13 73 ....... gnd 113 ....... oe# 153 ....... gnd 34 ....... d12 74 ....... reset# 114 ....... iord# 154 ....... a17 35 ....... d11 75 ....... grant# 115 ....... we2# /be2# 155 ....... a18 36 ....... d10 76 ....... vcc 116 ....... we3# /be3# 156 ....... bootb 37 ....... nc 77 ....... nc 117 ....... nc 157 ....... nc 38 ....... nc 78 ....... nc 118 ....... nc 158 ....... nc 39 ....... gnd 79 ....... gnd 119 ....... gnd 159 ....... gnd 40 ....... vcc 80 ....... vcc 120 ....... vcc 160 ....... vcc
7 - 4 chapter 7 7 . 2 g ms30c2232, 144 - pin tqfp - package 7 . 2 . 1 pin configuration - view from top side 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 108 107 106 105 104 103 102 101 100 99 98 96 95 94 93 92 91 90 89 88 87 86 85 123 124 125 126 127 128 129 130 131 132 133 97 48 47 46 45 44 43 71 70 69 68 67 66 65 64 63 62 49 50 a20 a21 gnd d31 d30 d29 a9 a10 a11 a12 vcc d28 d27 d26 gnd d25 d15 d14 vcc d13 d12 d11 d10 gnd vcc gnd xtal1/clkin xtal2 io2 vcc d16 d17 d18 a3 a2 a1 a0 gnd dp1 dp0 clkout io1 gnd rqst int4 int3 int2 int1 gnd vcc vcc gnd bootb a18 a17 gnd vcc a16 a15 a25 gnd a24 a23 gnd vcc a22 a8 a7 vcc a6 a5 a4 gnd we0# /be0# we1# /be1# gnd gnd d8 d7 vcc gnd d6 d24 vcc d23 d22 gnd d5 d4 d3 vcc d2 d1 d0 vcc gnd d21 d20 84 83 gnd d19 dp2 dp3 vcc gnd reset# grant# vcc gnd vcc 61 60 59 58 57 56 55 54 53 52 51 vcc gnd we3# we2# iord# oe# vcc cas3# cas2# cas1# 26 27 28 29 30 31 32 33 34 35 36 vcc cas0# a14 gnd vcc act a13 gnd we# gnd vcc 134 135 136 137 138 139 140 141 142 143 144 vcc gnd io3 iowr# cs3# cs2# cs1# gnd ras# a19 vcc 72 bootw vcc d9 gms30c2 2 32 42 41 40 39 38 37 82 81 80 79 78 77 76 75 74 73 109 110 111 112 113 114 115 116 117 118 119 120 121 122 figure 7 . 2 : gms30c2 2 32, 144 - pin tqfp - package
mechanical data 7 - 5 7 . 2 . 2 pin cross reference by pin name signal location signal location signal location signal location a0 ................... 58 cs3# ............... 140 dp3 .................. 80 iowr # ............ 141 a1 ................... 57 d 0 ..................... 88 gnd ................... 2 oe # ................... 42 a2 ................... 56 d 1 ..................... 89 gnd ................... 6 ras # .............. 136 a3 ................... 55 d 2 ..................... 90 gnd .................. 11 rese t # ............ 77 a4 ................... 22 d 3 ..................... 92 gnd ................. 14 rqst ................ 66 a5 ................... 21 d 4 ..................... 93 gnd ................. 23 vcc .................... 1 a6 ................... 20 d 5 ..................... 94 gnd ................. 29 vcc .................... 7 a7 ................... 18 d 6 ................... 100 gnd ................. 33 vcc .................. 15 a8 ................... 17 d 7 ................... 103 gnd ................. 35 vcc .................. 19 a9 ................. 127 d 8 ................... 104 gnd ................. 38 vcc .................. 26 a10 ............... 126 d 9 ................... 1 06 gnd ................. 47 vcc .................. 30 a11 ............... 125 d 10 ................. 111 gnd ................. 59 vcc .................. 36 a12 ............... 124 d1 1 .................. 112 gnd ................. 65 vcc .................. 37 a1 3 ................. 32 d1 2 ................. 113 gnd ................. 71 vcc .................. 43 a14 ................. 28 d1 3 ................. 114 gnd ................. 74 vcc .................. 51 a15 ................... 9 d1 4 ................. 116 gnd ................. 78 vcc .................. 72 a16 ................... 8 d1 5 ................. 117 gnd ................. 83 vcc .................. 73 a17 ................... 5 d1 6 ................... 52 gnd ................. 86 vcc .................. 75 a18 ................... 4 d1 7 ................... 53 gnd ................. 95 vcc .................. 79 a19 ............... 135 d 18 ................... 54 gnd ............... 101 vcc .................. 87 a20 ............... 133 d 19 ................... 82 gnd ............... 105 vcc .................. 91 a21 ............... 132 d 20 ................... 84 gnd ............... 107 vcc .................. 98 a22 ................. 16 d2 1 ................... 85 gnd ................ 110 vcc ................ 102 a23 ................. 13 d2 2 ................... 96 gnd ................ 119 vcc ................ 108 a24 ................. 12 d2 3 ................... 97 gnd ............... 131 vcc ................ 109 a25 ................. 10 d2 4 ................... 99 gnd ............... 137 vcc ................ 115 act ................ 31 d2 5 ................. 118 gnd ............... 143 vcc ................ 123 bootb ............. 3 d2 6 ................. 120 grant # ........... 76 vcc ................ 134 bootw .......... 62 d2 7 ................. 121 int 1 .................. 70 vcc ................ 144 cas 0 # ............ 27 d 28 ................. 122 int 2 .................. 69 we# .................. 34 cas 1 # ............ 46 d 29 ................. 128 int3/wait ........ 68 we0# /be0# ...... 24 cas2# ............ 45 d 30 ................. 129 i nt4 .................. 67 we1# /be1# ...... 25 c a s 3 # ............ 44 d 31 ................. 130 io 1 .................... 64 we2# /be2# ...... 40 clkout ......... 63 dp 0 ................... 61 io2 .................... 50 we3# /be3# ...... 39 cs 1 # ............ 138 dp 1 ................... 60 io3 .................. 142 xtal1/clkin ... 48 cs2# ............ 139 dp2 ................... 81 iord # ............. 41 xtal2 ............... 49
7 - 6 chapter 7 7 . 2 . 3 pin cross reference by location location signal location signal location signal location signal 1 ....... vcc 37 ....... vcc 73 ....... vcc 109 ....... vcc 2 ....... gnd 38 ....... gnd 74 ....... gnd 110 ....... gnd 3 ....... bootb 39 ....... we3# /be3# 75 ....... vcc 111 ....... d10 4 ....... a18 40 ....... we2# /be2# 76 ....... grant# 112 ....... d11 5 ....... a17 41 ....... iord# 77 ....... reset# 113 ....... d12 6 ....... gnd 42 ....... oe# 78 ....... gnd 114 ....... d13 7 ....... vcc 43 ....... vcc 79 ....... vcc 115 ....... vcc 8 ....... a16 44 ....... cas3# 80 ....... dp3 116 ....... d14 9 ....... a15 45 ....... cas2# 81 ....... dp2 117 ....... d15 10 ....... a25 46 ....... cas1# 82 ....... d19 118 ....... d25 11 ....... gnd 47 ....... gnd 83 ....... gnd 119 ....... gnd 12 ....... a24 48 ....... xtal1/clkin 84 ....... d20 1 20 ....... d26 13 ....... a23 49 ....... xtal2 85 ....... d21 121 ....... d27 14 ....... gnd 50 ....... io2 86 ....... gnd 122 ....... d28 15 ....... vcc 51 ....... vcc 87 ....... vcc 123 ....... vcc 16 ....... a22 52 ....... d16 88 ....... d0 124 ....... a12 17 ....... a8 53 ....... d17 89 ....... d1 125 ....... a11 18 ....... a7 54 ....... d18 90 ....... d2 126 ....... a10 19 ....... vcc 55 ....... a3 91 ....... vcc 127 ....... a9 20 ....... a6 56 ....... a2 92 ....... d3 128 ....... d29 21 ....... a5 57 ....... a1 93 ....... d 4 129 ....... d30 22 ....... a4 58 ....... a0 94 ....... d5 130 ....... d31 23 ....... gnd 59 ....... gnd 95 ....... gnd 131 ....... gnd 24 ....... we0# /be0# 60 ....... dp1 96 ....... d22 132 ....... a21 25 ....... we1# /be1# 61 ....... dp0 97 ....... d23 133 ....... a20 26 ....... vcc 62 ....... vcc 98 ....... vcc 134 ....... vcc 27 ....... cas0# 63 ....... clkout 99 ....... d24 135 ....... a19 28 ....... a14 64 ....... io1 100 ....... d6 136 ....... ras# 29 ....... gnd 65 ....... gnd 101 ....... gn d 137 ....... gnd 30 ....... vcc 66 ....... rqst 102 ....... vcc 138 ....... cs1# 31 ....... act 67 ....... int4 103 ....... d7 139 ....... cs2# 32 ....... a13 68 ....... int3 104 ....... d8 140 ....... cs3# 33 ....... gnd 69 ....... int2 105 ....... gnd 141 ....... iowr# 34 ....... we# 70 ....... int1 106 ....... d9 142 ....... io3 35 ....... gnd 71 ....... gnd 107 ....... gnd 143 ....... gnd 36 ....... vcc 72 ....... vcc 108 ....... vcc 144 ....... vcc
mechanical data 7 - 7 7 . 3 gms30c2 2 16, 100 - pin tqfp - package 7 . 3 . 1 pin configuration - view from top side 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 75 74 73 72 71 70 69 68 67 66 65 63 62 61 60 59 58 57 56 55 54 53 90 91 92 93 94 95 96 97 98 99 100 64 37 36 35 34 33 32 38 39 a20 a21 gnd a9 a10 a11 a12 vcc gnd d15 d14 vcc d13 d12 d11 d10 gnd xtal1/clkin xtal2 io2 vcc a3 a2 a1 a0 gnd clkout io1 gnd rqst int4 int3 /wait int2 int1 bootb a18 a17 gnd vcc a16 a15 gnd gnd vcc a8 a7 vcc a6 a5 a4 gnd gnd d8 d7 vcc gnd d6 gnd d5 d4 d3 vcc d2 d1 d0 vcc gnd gnd vcc gnd reset# grant# vcc we1# /be1# we0# /be0# iord# oe# vcc cas1# cas0# vcc a14 gnd vcc act a13 gnd we# io3 iowr# cs3# cs2# cs1# gnd ras# a19 vcc 50 d9 gms30c2 2 16 31 30 29 28 27 26 77 79 80 81 82 83 84 85 86 87 88 89 76 78 48 47 49 46 45 44 43 42 41 40 52 51 dp0 dp1 figure 7 . 3 : gms30c2 2 16, 100 - pin tqfp - package
7 - 8 chapter 7 7 . 3 . 2 pin cross reference by pin name signal location signal location signal location signal location a0 ................... 41 cas1# ............... 31 gnd .................... 9 i o wr # .............. 99 a1 ................... 40 clkout ............ 43 gnd .................. 17 oe # ................... 29 a2 ................... 39 cs 1 # ................. 9 6 gnd .................. 20 ras # ................ 94 a3 ................... 38 cs 2 # ................. 97 gnd .................. 24 reset .............. 53 a4 ................... 16 cs3# ................. 98 gnd .................. 33 rqst ................ 46 a5 ................... 15 d 0 ...................... 61 gnd .................. 42 vcc .................... 5 a6 ................... 14 d 1 ...................... 62 gnd .................. 45 vcc .................. 10 a7 ................... 12 d 2 ...................... 63 gnd .................. 54 vcc .................. 13 a8 ................... 11 d 3 ...................... 65 gnd .................. 58 vcc .................. 18 a9 ................... 88 d 4 ...................... 66 gnd .................. 59 vcc .................. 21 a10 ................. 87 d 5 ...................... 67 gnd .................. 68 vcc .................. 30 a11 ................. 86 d 6 ...................... 69 gnd .................. 70 vcc .................. 37 a12 ................. 85 d 7 ...................... 72 gnd .................. 74 vcc .................. 51 a13 ................. 23 d 8 ...................... 73 gnd .................. 83 vcc .................. 55 a14 ................. 19 d 9 ...................... 75 gnd .................. 89 vcc .................. 60 a15 ................... 7 d1 0 .................... 76 gnd .................. 95 vcc .................. 64 a16 ................... 6 d1 1 .................... 77 grant# ........... 52 vcc .................. 71 a17 ................... 3 d1 2 .................... 78 int 1 .................. 50 vcc .................. 80 a18 ................... 2 d1 3 .................... 79 int 2 .................. 49 vcc .................. 84 a19 ................. 93 d1 4 .................... 81 int 3/wait ........ 48 vcc .................. 92 a20 ................. 91 d 15 .................... 82 i nt4 .................. 47 we# .................. 25 a21 ................. 90 dp 0 ................... 57 io 1 .................... 44 we0# /be0# ...... 27 act ................ 22 dp1 ................... 56 io 2 .................. 136 we1# /be1# ...... 26 bootb ............. 1 gnd .................... 4 io 3 .................. 100 xtal1/clkin ... 34 cas 0 # ............ 3 2 gnd .................... 8 io rd # ............... 28 xtal2 ............... 35
mechanical data 7 - 9 7 . 3 . 3 pin cross reference by location location sig nal location signal location signal location signal 1 ....... bootb 26 ....... we1# /be1# 51 ....... vcc 76 ....... d10 2 ....... a18 27 ....... we0# /be0# 52 ....... grant# 77 ....... d11 3 ....... a17 28 ....... iord# 53 ....... reset# 78 ....... d12 4 ....... gnd 29 ....... oe# 54 ....... gnd 79 ....... d13 5 ....... vcc 30 ....... vcc 55 ....... vcc 80 ....... vcc 6 ....... a16 31 ....... cas1# 56 ....... dp1 81 ....... d14 7 ....... a15 32 ....... ca s0# 57 ....... dp0 82 ....... d15 8 ....... gnd 33 ....... gnd 58 ....... gnd 83 ....... gnd 9 ....... gnd 34 ....... xtal1/clkin 59 ....... gnd 84 ....... vcc 10 ....... vcc 35 ....... xtal2 60 ....... vcc 85 ....... a12 11 ....... a8 36 ....... io2 61 ....... d0 86 ....... a11 12 ....... a7 37 ....... vcc 62 ....... d1 87 ....... a10 13 ....... vcc 38 ....... a3 63 ....... d2 88 ....... a9 14 ....... a6 39 ....... a2 64 ....... vcc 89 ....... gnd 15 ....... a5 40 ....... a1 65 ....... d3 90 ....... a21 16 ....... a4 41 ....... a0 66 ....... d4 91 ....... a20 17 ....... gnd 42 ....... gnd 67 ....... d5 92 ....... vcc 18 ....... vcc 43 ....... clkout 68 ....... gnd 93 ....... a19 19 ....... a14 44 ....... io1 69 ....... d6 94 ....... ras# 20 ....... gnd 45 ....... gnd 70 ....... gnd 95 ....... gnd 21 ....... vcc 46 ....... rqst 71 ....... vcc 96 ....... cs1# 22 ....... act 47 ....... int4 72 ....... d7 97 ....... cs2# 23 ....... a13 48 ....... int3 /wait 73 ....... d8 98 ....... cs3# 24 ....... gnd 49 ....... int2 74 ....... gnd 99 ....... iowr# 25 ....... we# 50 ....... int1 75 ....... d9 100 ....... io3
7 - 10 chapter 7 7 . 4 package - dimensions b d d 1 e 1 index a 1 a 2 l q e p figure 7 . 4 : gms30c2 2 32, gms30c2 2 16 package - outline symbol term definition a1 standoff height height from ground plan e to bottom edge of package a2 package height height of package itself e, d overall length & width length and width including leads d1, e1 package length & width length and width of package l length of flat lead section length of flat lead section p l ead pitch lead pitch b lead width width of a lead q lead angle angle of lead versus seating plane
mechanical data 7 - 11 gms30c2 2 32, 160 - pin mqfp - package symbol dimensions in millimeters dimensions in inches min. nom. max. min. nom. max a1 0.25 0.36 0.47 (0.010) (0.014) ( 0.018) a2 3.20 3.40 3.60 (0.126) (0.134) (0.142) e, d 31.20 31.90 32.15 (1.228) (1.256) (1.266) e1, d1 27.90 28.00 28.10 (1.098) (1.102) (1.106) l 0.63 0.88 1.03 (0.025) (0.035) (0.041) p 0.65 (0.0256) b 0.22 0.29 0.38 (0.009) (0.012) (0.015) q 0 7 (0) (7) gms30c2232, 144 - pin tqfp - package symbol dimensions in millimeters dimensions in inches min. nom. max. min. nom. max a1 0.05 0.10 0.15 (0.002) (0.004) (0.006) a2 1.35 1.40 1.45 (0.053) (0.055) (0.057) e, d 21.80 22.00 22.20 (0.858) ( 0.866) (0.874) e1, d1 19.90 20.00 20.10 (0.783) (0.787) (0.791) l 0.45 0.60 0.75 (0.018) (0.024) (0.030) p 0.50 (0.0197) b 0.17 0.22 0.27 (0.007) (0.009) (0.011) q 0 7 (0) (7) gms30c2 2 16, 100 - pin tqfp - package symbol dimensions in millimeter s dimensions in inches min. nom. max. min. nom. max a1 0.05 0.10 0.15 (0.002) (0.004) (0.006) a2 1.35 1.40 1.45 (0.053) (0.055) (0.057) e, d 15.80 16.00 16.20 (0.622) (0.630) (0.638) e1, d1 13.90 14.00 14.10 (0.547) (0.551) (0.555) l 0.45 0.60 0.75 (0.018) (0.024) (0.030) p 0.50 (0.0197) b 0.17 0.22 0.27 (0.007) (0.009) (0.011) q 0 7 (0) (7)

appendix a. instruction set details a - 1 appendix . instruction set details this appendix provides a detailed description of the operation of each gms 30c2 2 16/32 risc/dsp instruction. the instructions are listed in alphabet order. the exceptions that may occur due to the execution of each instruction are listed after the description of each instruction. the description of the immediate causes and manner of handling exceptions is omitted from the instruction description in this chapter. refer to chapter 4 for detailed description of exceptions and handling. instruction classes gms30c2 2 16/32 risc/dsp instructions are divided into 7 classes 1. memory instructi on: load data form memory in a register or store data from a register to memory. i/o devices are also addressed by memory instructions. 2. move instruction: source operand or the immediate operand is copied to the destination register. 3. computational instructi on: perform arithmetic, logical, shift and rotate operations on values in registers. 4. branch and delayed branch instruction: when the branch condition is met, place the branch address pc+rel in the program counter pc and clear the cache - mode flag m. 5. extende d dsp instruction: the extended dsp functions use the on - chip multiply - accumulate unit. 6. software instruction: cause a branch to the subprogram associated with each software instruction. 7. special instruction: call, trap, frame, return and fetch instruction instruction notation instruction notation is same as the notation of using chapter 2 and 3. (see section 2.1 instruction notation)
a - 2 appendix a. instruction set details add add format: rr format rd-code rs-code op-code 0010 10 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: add rd, rs add rd, c (when sr is denoted as a rs) description: the source operand (rs) is added to the destination operand (rd), the result is placed in the destination register (rd) and the condition flag are set or cleared accordingly. both operands and the result are interpreted as either all signed or all unsigned integers. when th e sr is denoted as a source operand, carry flag c is added instead of the sr. operation: when rs is not sr rd := rd + rs; z := rd = 0; n := rd(31); v := overflow; c := carry; when rs is sr rd := rd + c; z := rd = 0; n := rd(31); v := overflow; c := carry; exceptions: none.
appendix a. instruction set details a - 3 add with carry addc format: rr format rd-code rs-code op-code 0101 00 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: addc rd, rs addc rd, c (when sr is denoted as a rs) description: the source operand (rs) + c is added to the destination operand (rd), the result is placed in the destination register (rd) and the condition flag are set or cleared accordingly. both operands and the result are interpreted as either all signed or all unsigned integers. when the s r is denoted as a source operand, carry flag c is added instead of the sr. operation: when rs is not sr rd := rd + rs + c; z := z and (rd=0); n := rd(31); v := overflow; c := carry; when rs is sr rd := rd + c; z := z and (rd=0); n := rd(31); v := overflow; c := carry; exceptions: none.
a - 4 appendix a. instruction set details add immediate addi format: rimm format d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd n: bit 8 // bit 3..0 encode n = 0..31, see table 2.3 encoding of immediate values rd-code n op-code 0100 10 d n 15 10 9 8 7 4 3 0 imm1 imm2 notation: addi rd, imm addi rd, cz (when n = 0 ) description: the immediate operand (imm) is added to the destination operand (rd), the result is placed in the destination register (rd) and the condition flag are set or cleared accordingly. both operands and the result are interpreted as either all signed or all unsigned integers. when the immediate value n = 0, c is only added to the destination operand if z = 0 or rd(0) is one (round to even). operation: when n is not zero rd := rd + imm; z := rd = 0; n := rd(31); v := overflow; c := carry; when n is zero rd := rd + (c and (z=0 or rd(0))); z := rd = 0 n := rd(31); v := overflow; c := carry; exceptions: none.
appendix a. instruction set details a - 5 signed add with trap adds format: rr format rd-code rs-code op-code 0010 11 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: adds rd, rs adds rd, c (when sr is denoted as a rs) description: the s ource operand (rs) is added to the destination operand (rd), the result is placed in the destination register (rd) and the condition flag are set or cleared accordingly. both operands and the result are signed integers and a trap to range error occurs at o verflow. when the sr is denoted as a source operand, carry flag c is added instead of the sr. operation: when rs is not sr rd := rd + rs; z := rd = 0; n := rd(31); v := overflow; if overflow then trap -> range error when rs is sr rd := rd + c; z := rd = 0; n := rd(31); v := overflow; if overflow then trap -> range error exceptions: overflow exception (trap to range error).
a - 6 appendix a. instruction set details signed add immediate with trap addsi format: rimm format d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd n: bit 8 // bit 3..0 encode n = 0..31, see table 2.3 encoding of immediate values rd-code n op-code 0110 11 d n 15 10 9 8 7 4 3 0 imm1 imm2 notation: addsi rd, imm addsi rd, cz (when n = 0 ) description: the immediate operand (imm) is added to the destination operand (rd), the result is placed in the destination register (rd) and the condition flag are set or cleared accordingly. both operands and the result are signed in tegers and a trap to range error occurs at overflow. when the immediate value n = 0, c is only added to the destination operand if z = 0 or rd(0) is one (round to even). operation: when rs is not sr rd := rd + imm; z := rd = 0; n := rd(31); v := overflow; if overflow then trap -> range error when rs is sr rd := rd + (c and (z=0 or rd(0))); z := rd = 0; n := rd(31); v := overflow; if overflow then trap -> range error exceptions: overflow exception (trap to range error)
appendix a. instruction set details a - 7 and and format: rr format rd-code rs-code op-code 0101 01 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: and rd, rs description: the result of a bitwise logical and of the source operand (rs) and the destination operand (rd) is placed in the destination register (rd) and the z flag is set or cleared accordingly. operation: rd := rd and rs; z := rd = 0; exceptions: none.
a - 8 appendix a. instruction set details and with source used inverted andn format: rr format rd-code rs-code op-code 0011 01 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: andn rd, rs description: the result of a bitwise logical and not (andn) of the source operand (rs) and the destination operand (rd) is placed in the destination register (rd) and the z flag is set or cleared accordingly. the source operand is used inverted (itself remaining unchanged). operation: rd := rd and not rs; z := rd = 0; exceptions: none.
appendix a. instruction set details a - 9 and with imm used inverted andni format: rimm format d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd n: bit 8 // bit 3..0 encode n = 0..31, see table 2.3 encoding of immediate values rd-code n op-code 0111 01 d n 15 10 9 8 7 4 3 0 imm1 imm2 notation: andni rd, imm description: the result of a bitw ise logical and not (andn) of the source operand (rs) and the immediate operand (rd) is placed in the destination register (rd) and the z flag is set or cleared accordingly. the immediate operand is used inverted (itself remaining unchanged). operation: rd := rd and not imm; z := rd = 0; exceptions: none.
a - 10 appendix a. instruction set details branch on carry bc format: pcrel format low-rel op-code 1111 0100 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bc rel description: if the carry flag c is set (c = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and cle ar the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution p roceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if c = 1 then pc := pc + rel m := 0 exceptions: none.
appendix a. instruction set details a - 11 branch on equal be format: pcrel format low-rel op-code 1111 0010 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: be rel description: if the zero flag is set (z = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if z = 1 then pc := pc + rel m := 0 exceptions: none.
a - 12 appendix a. instruction set details branch on greater or equal bge format: pcrel form at low-rel op-code 1111 1001 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bge rel description: if the negative flag n is cleared (n = 0, non - negative), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all conditi on flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is si gned to allow forward or backward branches. operation: if n = 0 then pc := pc + rel m := 0 exceptions: none.
appendix a. instruction set details a - 13 branch on greater than bgt format: pcrel format low-rel op-code 1111 1011 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bgt rel description: if the negative flag n and the zero flag z are cleared (n = 0 and z = 0), place the branch addr ess pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the bran ch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if n=0 and z=0 then pc := pc + rel m := 0 exceptions: none.
a - 14 appendix a. instruction set details branch on higher or equal bhe format: pcrel format low-rel op-code 1111 0101 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bhe rel description: if the carry flag c is cleared (c = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition fl ags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if c = 0 then pc := pc + rel m := 0 exceptions: none.
appendix a. instruction set details a - 15 branch on higher than bht format: pcrel format low-rel op-code 1111 0111 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bhe rel description: if the carry flag c and the zero flag z are cleared (c = 0 and z = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condit ion is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if c=0 and z=0 then pc := pc + rel m := 0 exceptions: none.
a - 16 appendix a. instruction set details branch on less or equal ble format: pcrel for mat low-rel op-code 1111 1010 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: ble rel description: if the negative flag n is set or the zero flag z is set (n = 1 or z = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode f lag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentiall y. note: rel is signed to allow forward or backward branches. operation: if n=1 or z=1 then pc := pc + rel m := 0 exceptions: none.
appendix a. instruction set details a - 17 branch on less than blt format: pcrel format low-rel op-code 1111 1000 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: blt rel description: if the negative flag n is set (n = 1), place the branch address pc + rel (relati ve of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if n = 1 then pc := pc + rel m := 0 exceptions: none.
a - 18 appendix a. instruction set details branch on negative bn format: pcrel format low-rel op-code 1111 1000 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: b n rel description: if the negative flag n is set (n = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then in struction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if n = 1 then pc := pc + rel m := 0 exceptions: none.
appendix a. instruction set details a - 19 branch on no carry bnc format: pcrel format low-rel op-code 1111 0101 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bnc rel description: if the carry flag c is cleared (c = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) i n the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain uncha nged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if c = 0 then pc := pc + rel m := 0 exceptions: none.
a - 20 appendix a. instruction set details branch on not equal bne format: pcrel format low-rel op-code 1111 0011 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bne rel description: if the zero flag z is cleare d (z = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch addres s placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if z = 0 then pc := pc + rel m := 0 exceptions: none.
appendix a. instruction set details a - 21 branch on non - negative bnn format: pcrel format low-rel op-code 1111 1001 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bnn rel description: if the negative flag n is cleared (n = 0, non - negative), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc an d clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execut ion proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if n = 0 then pc := pc + rel m := 0 exceptions: none.
a - 22 appendix a. instruction set details branch on not overflow bnv format: pcrel format low-rel op-code 1111 0001 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bnv rel description: if the overflow flag v is cleared (v = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc w hen the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if v = 0 then pc := pc + rel m := 0 exceptions: none.
appendix a. instruction set details a - 23 branch on none - zero bnz format: pcrel format low-rel op-code 1111 0011 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bnz rel description: if the zero flag z is cleared (z = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condit ion flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is s igned to allow forward or backward branches. operation: if z = 0 then pc := pc + rel m := 0 exceptions: none.
a - 24 appendix a. instruction set details branch on smaller or equal bse format: pcrel format low-rel op-code 1111 0110 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bse rel description: if the carry flag c is set (c = 1) or the zero flag is set (z = 1), place the branch addr ess pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc when the bran ch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if c=1 or z=1 then pc := pc + rel m := 0 exceptions: none.
appendix a. instruction set details a - 25 branch br format: pcrel format low-rel op-code 1111 1100 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s no tation: br rel description: place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc note: rel is signed to allow forward or backward branches. operation: pc := pc + rel m := 0 exceptions: none.
a - 26 appendix a. instruction set details branch on overflow bv format: pcrel format low-rel op-code 1111 0000 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bv rel description: if the overflow flag v is set (v = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc wh en the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if v = 1 then pc := pc + rel m := 0 exceptions: none.
appendix a. instruction set details a - 27 branch on zero bz format: pcrel format low-rel op-code 1111 0010 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: bz rel description: if the zero flag is set (z = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc and clear the cache - mode flag m; all condition flags remai n unchanged. then instruction execution proceeds at the branch address placed in the pc when the branch condition is not met, the m flag and the condition flags remain unchanged and instruction execution proceeds sequentially. note: rel is signed to allow forward or backward branches. operation: if z = 1 then pc := pc + rel m := 0 exceptions: none.
a - 28 appendix a. instruction set details call call format: lrconst format s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs, ld-code encodes l0..l15 for ld s: sign bit of const e = 0: const = 18s // const1, range -16,384 ~ 16,383 e = 1: const = 2s // const1 // const2, range -1,073,741,824 ~ 1,073,741,823 ld-code rs-code op-code 1110111 s 15 9 8 7 4 3 0 imm1 imm2 const1 const2 e s notation: call ld, rs, const call ld, 0, const (when rs denotes sr) description: the call instruction causes a branch to a subprogram. the branch address rs + const, or const alone if rs denotes the sr, is placed in the program counter pc. the old pc containing the return address is saved in ld; the old supervisor - state flag s is also saved in bit zero of ld. the old status register sr is saved in ldf, the saved instruction - length code ilc contains the length (2 or 3) of the call instruction. then the frame pointer fp is incremented by the value of the ld - code and the frame length fl is set to six, thus creating a new stack frame. the cache - mode flag m is cleared. all condition flags remain unchanged. then instruction execution proceeds at the branch address placed in the pc. operation: if rs denotes not sr then pc := rs +const else pc := const ld := old pc(31..1) // old s; ldf := old sr; fp := fo + ld code; (ld-cod 0 is treated as 16) fl := 6; m:= 0; exceptions: none.
appendix a. instruction set details a - 29 check chk format: rr format rd-code rs-code op-code 0000 00 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: chk rd, rs description: a destination operand is checked a nd a trap to a range error occurs if the destination operand is higher than the source operand. all registers and all condition flags remain unchanged. all operands are interpreted as unsigned integers. when rs denotes the pc, chk trap if rd > pc. thus, c hk pc, pc always traps. since chk pc, pc is encoded as 16 zeros, an erroneous jump into a string of zeros causes a trap to range error, thus trapping some address errors. operation: if rs does not denote sr and rd > rs then trap -> range error exceptions: range error.
a - 30 appendix a. instruction set details check zero chkz format: rr format rd-code rs-code op-code 0000 00 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notatio n: chk rd, 0 description: a destination operand is checked and a trap to a range error occurs if the destination operand is zero. all registers and all condition flags remain unchanged. all operands are interpreted as unsigned integers. chkz shares its ba sic op - code with chk, it is differentiated by denoting the sr as source operand. chkz may be used to trap on uninitialized pointers with the value zero. operation: if rs denotes sr and rd = 0 then trap -> range error exceptions: range error.
appendix a. instruction set details a - 31 compare with source operand cmp format: rr format rd-code rs-code op-code 0010 00 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: cmp rd, rs cmp rd, c (when rs denotes sr) description: two operands are compared by subtracting the source operand from the destination operand. the condition flags are set or cleared according to the result; the result itself is not retained. note that the n flag indicates the correct compare result even in the case of an overflow. all operands and the result are interpreted as either all signed or all unsigned integers. when the sr is denoted as a source operand at cmp, c is subtracted instead of sr. op eration: when rs is not sr result := rd - rs; z := rd = rs; n := rd < rs signed; v := overflow; c := rd < rs unsigned; when rs is sr result := rd - c; z := rd = c; n := rd < c signed; v := overflow; c := rd < c unsigned; exceptions: none
a - 32 appendix a. instruction set details compare bit cmpb format: rr format rd-code rs-code op-code 0011 00 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: cmpb rd, rs description: the result of a bitwise logical and of the source operand and the destination operand is used to set or clear the z flag accordingly; the result itself is not retained. all operands and the result are interpreted as bit - string of 32 bits each. operation: z := (rd and rs) = 0; exceptions: none
appendix a. instruction set details a - 33 compare bit with immediate cmpbi format: rimm format d = 0: rd-code encoded g0..g15 for rd d = 0: rd-code encoded l0..l15 for rd n: bit 8 // bit 3..0 encode n = 0..31, see table 2.3 encoding of immediate values rd-code n op-code 0111 00 d n 15 10 9 8 7 4 3 0 imm1 imm2 notation: cmpbi rd, imm cmpbi rd, anybz (when n = 0) description: the r esult of a bitwise logical and of the immediate operand and the destination operand is used to set or clear the z flag accordingly; the result itself is not retained. all operands and the result are interpreted as bit - string of 32 bits each. a special case of cmpbi differentiated by n = 0, if any byte of the destination operand is zero then the zero flag z is set (z = 1). operation: if n is not zero then z := (rd and imm); else z := rd(31..24) = 0 or rd(23..16) = 0 or rd(15..8) = 0 or rd(7..0) = 0 exceptions: none
a - 34 appendix a. instruction set details compare with immediate cmpi format: rimm format d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd n: bit 8 // bit 3..0 encode n = 0..31, see table 2.3 encoding of immediate values rd-code n op-code 0110 00 d n 15 10 9 8 7 4 3 0 imm1 imm2 notation: cmpi rd, imm description: two operands are compared by subtracting the source operand from the destination operand. the condition flags are set or cleared according to the result; the result itself is not retained. note that the n flag indicates the correct compare result even in the case of an ov erflow. all operands and the result are interpreted as either all signed or all unsigned integers. operation: result := rd - imm; z := rd = imm; n := rd < imm signed; v := overflow; c := rd < imm unsigned; exceptions: none
appendix a. instruction set details a - 35 divide with non - negative signed divs format: rr format rd-code rs-code op-code 0000 11 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: divs rd, rs description: the double - word destination op erand (dividend) is divided by the single - word source operand (divisor), the quotient is placed in the low - order destination register (rdf), the remainder is placed in the high - order destination register (rd) and the condition flags are set or cleared acco rding to the quotient. a trap to range error occurs if the divisor is zero or the value of the quotient exceeds the integer value range (quotient overflow). the result (in rd//rdf) is then undefined. a trap to range error also occurs and the result is unde fined if the dividend is negative. the dividend is a non - negative signed double - word integer, the devisor, the quotient and the remainder are signed integers; a non - zero remainder has the sign of the dividend. the result is undefined if rs denotes the sam e register as rd or rdf or if the pc or the sr is denoted. operation: if rs = 0 or quotient overflow or rd(31) = 1 then rd//rdf := undefined; z := undefined;, n := undefined;, v :=1 trap -> range error else remainder rd, quotient rdf := (rd//rdf) / rs; z := rdf = 0 n := rd(31), v:= 0; exceptions: quotient overflow (trap to a range error) division by zero (trap to a range error) dividend is negative (trap to a range error)
a - 36 appendix a. instruction set details divide with unsigned divu format: rr form at rd-code rs-code op-code 0000 10 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: divu rd, rs description: the double - word destination operand (dividend) is divided by the single - word source operand (divisor), the quotient is placed in the low - order destination register (rdf), the remainder is placed in the high - order de stination register (rd) and the condition flags are set or cleared according to the quotient. a trap to range error occurs if the divisor is zero or the value of the quotient exceeds the integer value range (quotient overflow). the result (in rd//rdf) is t hen undefined. the dividend is an unsigned double - word integer, the devisor, the quotient and the remainder are unsigned integers the result is undefined if rs denotes the same register as rd or rdf or if the pc or the sr is denoted. operation: if rs = 0 or quotient overflow then rd//rdf := undefined; z := undefined;, n := undefined;, v :=1 trap -> range error else remainder rd, quotient rdf := (rd//rdf) / rs; z := rdf = 0 n := rd(31), v:= 0; exception s: quotient overflow (trap to a range error) division by zero (trap to a range error)
appendix a. instruction set details a - 37 do do format: ll format ld-code ls-code op-code 1100 1111 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld notation: do xx... ld, ls description: the do instruction is executed as a software instruction. (the software instructions causes a branch to the subprogram associated with each software instruction.) the associated subprogram is entered, the stack address other destination operand and one double - word source operand are passed to it. the halfword succeeding the do instruction will be used by the associated subprogram to differentiate branches to subordinate routines; the associated subprogram must increment the saved return program counter pc by two. ?xx...? stands for the mnemonic of the differentiating halfword after the op - code of the do i nstruction. operation: pc := 23 oness // 0 // op(11..8) // 4 zeros; (fp + fl)^ := stack address of ld; (fp + fl + 1)^ := ls; (fp + fl + 2)^ := lsf; (fp + fl + 3)^ := old pc(31..1) // old s; (fp + fl + 4)^ := old sr; fp := fp + fl, fl := 6;, m := 0; t := 0; l := 1; exceptions: none
a - 38 appendix a. instruction set details halfword (complex) add/sub with fixed - point adjustment ehcfftd format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0000 1001 0110 (0x0096) notation: ehcfftd ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp in struction is issued in one cycle; the processor starts execution of the next instruction before the extended dsp instruction is finished. double - word results are always placed in g14 and g15. the condition flags remain unchanged ls does not used and should denote he same register. this instruction can cause a n extended overflow exception when the extended overflow exception flag is enabled (fcr(16) = 0). note that this overflow occurs asynchronously to the execution of the extended dsp instruction and any succeeding instructions. operation: g14(31..16) ;= ld(31..16) + (g14 >> 15); g14(15..0) ;= ld(15..0) + (g15 >> 15); g15(31..16) ;= ld(31..16) - (g14 >> 15); g15(15..0) ;= ld(15..0) - (g15 >> 15); exceptions: extended overflow exception
appendix a. instruction set details a - 39 halfword complex multiply/add ehcmacd format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0000 0100 1110 (0x004e) notation: ehcmacd ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an exte nded dsp instruction is issued in one cycle; the processor starts execution of the next instruction before the extended dsp instruction is finished. double - word results are always placed in g14 and g15. the condition flags remain unchanged this instruction can cause a n extended overflow exception when the extended overflow exception flag is enabled (fcr(16) = 0). note that this overflow occurs asynchronously to the execution of the extended dsp instruction and any succeeding instructions. operation: g14 := g14 + ld(31..16) * ls(31..16) - ld(15..0) * ls(15..0); g15 := g15 + ld(31..16) * ls(31..16) + ld(15..0) * ls(15..0); exce ptions: extended overflow exception
a - 40 appendix a. instruction set details halfword complex multiply ehcmuld format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0000 0100 0110 (0x0046) notation: ehcmuld ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cycle; t he processor starts execution of the next instruction before the extended dsp instruction is finished. double - word results are always placed in g14 and g15. the condition flags remain unchanged this instruction can cause a n extended overflow exception whe n the extended overflow exception flag is enabled (fcr(16) = 0). note that this overflow occurs asynchronously to the execution of the extended dsp instruction and any succeeding instructions. operation: g14 := ld(31..16) * ls(31..16) - ld(15..0) * ls(15..0); g15 := ld(31..16) * ls(31..16) + ld(15..0) * ls(15..0); exceptions: extended overflow exception
appendix a. instruction set details a - 41 halfword (complex) add/subtract ehcsumd format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0000 1000 0110 (0x0086) notation: ehcsumd ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cycle; the processor starts execution of the nex t instruction before the extended dsp instruction is finished. double - word results are always placed in g14 and g15. the condition flags remain unchanged this instruction can cause a n extended overflow exception when the extended overflow exception flag i s enabled (fcr(16) = 0). note that this overflow occurs asynchronously to the execution of the extended dsp instruction and any succeeding instructions. operation: g14(31..16) := ld(31..16) + g14; g14(15..0) := ld(15..0) + g15; g15(31..16) := ld(31..16) - g14; g15(15..0) := ld(15..0) - g14; exceptions: extended overflow exception
a - 42 appendix a. instruction set details signed halfword multiply/add, single word product sum ehmac format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0000 0010 1010 (0x002a) notation: ehmac ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cycle; the processor starts execution of the next instruction before t he extended dsp instruction is finished. single - word results always use register g15 as destination register. the condition flags remain unchanged this instruction can cause a n extended overflow exception when the extended overflow exception flag is enabl ed (fcr(16) = 0). note that this overflow occurs asynchronously to the execution of the extended dsp instruction and any succeeding instructions. operation: g15 := g15 + ld(31..16) * ls(31..16) + ld(15..0) * ls(15..0); exceptions: extended overflow exception
appendix a. instruction set details a - 43 signed halfword multiply/add, double word product sum eh macd format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0000 0010 1110 (0x002e) notation: ehmacd ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cycle; the processor starts execution of the next instruction before the ex tended dsp instruction is finished. double - word results are always placed in g14 and g15. the condition flags remain unchanged this instruction can cause a n extended overflow exception when the extended overflow exception flag is enabled (fcr(16) = 0). no te that this overflow occurs asynchronously to the execution of the extended dsp instruction and any succeeding instructions. operation: g14//g15 = g14//g15 + ld(31..16) * ls(31..16) + ld(15..0) * ls(15..0); exceptions: extended overflow exception
a - 44 appendix a. instruction set details signed multiply/add, single word product sum emac format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0001 0000 1010 (0x010a) n otation: emac ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cycle; the processor starts execution of the next instruction before the extended dsp instruction is finishe d. single - word results always use register g15 as destination register. the condition flags remain unchanged this instruction can cause a n extended overflow exception when the extended overflow exception flag is enabled (fcr(16) = 0). note that this overf low occurs asynchronously to the execution of the extended dsp instruction and any succeeding instructions. operation: g15 = g15 + ld * ls exceptions: extended overflow exception
appendix a. instruction set details a - 45 signed multiply/add, double word product sum emacd format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0001 0000 1110 (0x010e) notation: emacd l d, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cycle; the processor starts execution of the next instruction before the extended dsp instruction is finished. double - word r esults are always placed in g14 and g15. the condition flags remain unchanged this instruction can cause a n extended overflow exception when the extended overflow exception flag is enabled (fcr(16) = 0). note that this overflow occurs asynchronously to th e execution of the extended dsp instruction and any succeeding instructions. operation: g14//g15 = g14//g15 + ld * ls exceptions: extended overflow exception
a - 46 appendix a. instruction set details signed multiply/subtract, single word product difference emsub format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0001 0001 1010 (0x011a) notation: emsub ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cycle; the processor starts execution of the next instruction before the extended dsp instruction is finished. single - word results always use r egister g15 as destination register. the condition flags remain unchanged this instruction can cause a n extended overflow exception when the extended overflow exception flag is enabled (fcr(16) = 0). note that this overflow occurs asynchronously to the ex ecution of the extended dsp instruction and any succeeding instructions. operation: g15 = g15 - ld * ls exceptions: extended overflow exception
appendix a. instruction set details a - 47 signed multiply/subtract, double word product difference emsubd format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0001 0001 1110 (0x011e) notation: emsubd ld, ls description: th e extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cycle; the processor starts execution of the next instruction before the extended dsp instruction is finished. double - word results are always pla ced in g14 and g15. the condition flags remain unchanged this instruction can cause a n extended overflow exception when the extended overflow exception flag is enabled (fcr(16) = 0). note that this overflow occurs asynchronously to the execution of the ex tended dsp instruction and any succeeding instructions. operation: g14//g15 = g14//g15 - ld * ls exceptions: extended overflow exception
a - 48 appendix a. instruction set details signed or unsigned multiplication, single word product emul format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0001 0000 0000 (0x0100) notation: emul ld, ls description: the extended dsp instruct ion uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cycle; the processor starts execution of the next instruction before the extended dsp instruction is finished. single - word results always use register g15 as destinatio n register. the condition flags remain unchanged operation: g15 = ld * ls exceptions: none.
appendix a. instruction set details a - 49 signed multiplication, double word product emuls format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0001 0000 0110 (0x0106) notation: emuls ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate un it. an extended dsp instruction is issued in one cycle; the processor starts execution of the next instruction before the extended dsp instruction is finished. double - word results are always placed in g14 and g15. the condition flags remain unchanged opera tion: g14//g15 = ld * ls exceptions: none.
a - 50 appendix a. instruction set details unsigned multiplication, double word product emulu format: llext format ld-code ls-code op-code 1100 1110 15 8 7 4 3 0 ls-code encoded l0..l15 for ls ld-code encoded l0..l15 for ld op-code extention 0000 0001 0000 0100 (0x0104) notation: emulu ld, ls description: the extended dsp instruction uses on - chip multiply - accumulate unit. an extended dsp instruction is issued in one cyc le; the processor starts execution of the next instruction before the extended dsp instruction is finished. double - word results are always placed in g14 and g15. the condition flags remain unchanged operation: g14//g15 = ld * ls exceptions: none.
appendix a. instruction set details a - 51 delayed branch on carry d bc format: pcrel format low-rel op-code 1110 0100 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbc rel description: if the carry flag c is set (c = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode fl ag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is exec uted like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (contain ing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if c = 0 then pc := pc + rel exceptions: none.
a - 52 appendix a. instruction set details delayed branch on equal dbe format: pcrel form at low-rel op-code 1110 0010 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbe rel description: if the zero flag is set (z = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. th en the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is executed like a regular instru ction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch tar get address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if z = 1 then pc := pc + rel exceptions: none.
appendix a. instruction set details a - 53 delayed branch on greater or equal dbge format: pcrel format low-rel op-code 1110 1001 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbge rel description: if the negative flag n is cleared (n = 0, non - negative), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unc hanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is executed like a reg ular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if n = 0 then pc := pc + rel exceptions: none.
a - 54 appendix a. instruction set details delayed branch on greater than dbgt format: pcrel format low-rel op-code 1110 1011 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s no tation: dbgt rel description: if the negative flag n and the zero flag z are cleared (n = 0 and z = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cach e mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instructio n is executed like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if n = 0 & z = 0 then pc := pc + rel exceptions: none.
appendix a. instruction set details a - 55 delayed branch on higher or equal dbhe format: pcrel format low-rel op-code 1110 1001 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbhe rel description: if the carry flag c is cleared (c = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is ex ecuted like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (conta ining the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if c = 0 then pc := pc + rel exceptions: none.
a - 56 appendix a. instruction set details delayed branch on higher than dbht format: p crel format low-rel op-code 1110 0111 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbhe rel description: if the carry flag c and the zero flag z are cleared (c = 0 and z = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the del ay instruction is executed like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch t arget. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if c = 0 & z = 0 then pc := pc + rel exceptions: none.
appendix a. instruction set details a - 57 delayed branch on less or equal dble format: pcrel format low-rel op-code 1110 1010 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dble rel description: if the negative flag n is set or the zero flag z is set (n = 1 or z = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counte r pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed bra nch is not taken, the delay instruction is executed like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if n = 1 or z = 1 then pc := pc + rel exceptions: none.
a - 58 appendix a. instruction set details d elayed branch on less than dblt format: pcrel format low-rel op-code 1110 1000 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dblt rel description: if the negative flag n is set (n = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all cond ition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not tak en, the delay instruction is executed like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at t he branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if n = 1 then pc := pc + rel exceptions: none.
appendix a. instruction set details a - 59 delayed branch on negative dbn format: pcrel format low-rel op-code 1110 1000 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbn rel description: if the negative flag n is set (n = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and t he cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay ins truction is executed like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if n = 1 then pc := pc + rel exceptions: none.
a - 60 appendix a. instruction set details delayed branch on no carry dbnc format: pcrel format low-rel op-code 1110 0101 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbnc rel description: if the carry flag c is cleared (c = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is ex ecuted like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (conta ining the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if c = 0 then pc := pc + rel exceptions: none.
appendix a. instruction set details a - 61 delayed branch on not equal dbne format: pc rel format low-rel op-code 1110 0011 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbne rel description: if the zero flag z is cleared (z = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is executed like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the del ayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if z = 0 then pc := pc + rel exceptions: none.
a - 62 appendix a. instruction set details delayed branch on non - negative dbnn format: pcrel format low-rel op-code 1110 1001 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbnn rel description: if the negative flag n is cleared (n = 0, non - negative), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is execute d like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if n = 0 then pc := pc + rel exceptions: none.
appendix a. instruction set details a - 63 delayed branch on not overflow dbnv format: pcre l format low-rel op-code 1110 0001 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbnv rel description: if the overflow flag v is cleared (v = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m rema in unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is executed like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the d elayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if v = 0 then pc := pc + rel exceptions: none.
a - 64 appendix a. instruction set details delayed branch on none - zero dbnz format: pcrel format low-rel op-code 1110 0011 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbnz rel description: if the zero flag z is cleared (z = 0), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is executed like a regular in struction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if z = 0 then pc := pc + rel exceptions: none.
appendix a. instruction set details a - 65 delayed branch on smaller or equal dbse format: pcrel format low-rel op-code 1110 0110 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s nota tion: dbse rel description: if the carry flag c is set (c = 1) or the zero flag is set (z = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode f lag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is exe cuted like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (contai ning the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if c = 1 or z = 1 then pc := pc + rel exceptions: none.
a - 66 appendix a. instruction set details delayed branch dbr format: pcrel format low-rel op-code 1110 1100 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s no tation: dbr rel description: place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed bra nch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken operation: pc := pc + rel exceptions: none.
appendix a. instruction set details a - 67 delayed branch on smaller than dbst format: pcrel format low-rel op-code 1110 0100 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbst rel description: if the carry flag c is set (c = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed bran ch instruction, called the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is executed like a regular instruction. the pc and the ilc are updated acc ordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if c = 1 then pc := pc + rel exceptions: none.
a - 68 appendix a. instruction set details delayed branch on overflow dbv format: pcrel format low-rel op-code 1110 0000 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbv rel description: if the overflow flag v is s et (v = 1), place the branch address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, c alled the delay instruction, is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is executed like a regular instruction. the pc and the ilc are updated accordingly and inst ruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if v = 1 then pc := pc + rel exceptions: none.
appendix a. instruction set details a - 69 delayed branch on zero dbz format: pcrel format low-rel op-code 1110 0010 15 6 8 7 0 s: sign bit of rel rel = 25 s // low-rel // 0 range -128 ~ 126 0 s notation: dbz rel description: if the zero flag is set (z = 1), place the branc h address pc + rel (relative of the first byte after the branch instruction) in the program counter pc. all condition flags and the cache mode flag m remain unchanged. then the instruction after the delayed branch instruction, called the delay instruction , is executed regardless of whether the delayed branch is taken or not taken. when the delayed branch is not taken, the delay instruction is executed like a regular instruction. the pc and the ilc are updated accordingly and instruction execution proceeds sequentially. when the delayed branch is taken, the delay instruction is executed before execution proceeds at the branch target. the pc (containing the delayed - branch target address) is not updated by the delay instruction. any reference to the pc by the delay instruction references the delayed - branch target address. operation: if z = 1 then pc := pc + rel exceptions: none.
a - 70 appendix a. instruction set details floating - point add (single precision) fadd format: ll format op-code 1100 0000 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fadd ld, ls description: the source operand (ls) is added to the destination operan d (ld), the result is placed in the destination register (ld) and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are execu ted as software instructions. this instruction uses single - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. operation: ld := ld + ls exceptions: invalid operation, division by zero, overfl ow, underflow or inexact.
appendix a. instruction set details a - 71 floating - point add (double precision) faddd format: ll format op-code 1100 0001 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: faddd ld, ls description: the source operand (ls//lsf) is added to the destination operand (ld//ldf), the result is placed in the destination register ( ld//ldf) and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. this instruction uses d ouble - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. operation: ld//ldf := ld//ldf + ls//lsf exceptions: invalid operation, division by zero, overflow, underflow or inexact.
a - 72 appendix a. instruction set details floating - point compare (si ngle precision) fcmp format: ll format op-code 1100 1000 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fcmpu ld, ls description: two operands are compared by subtracting the source operand form the destination operand and all condition flags remain unchanged to allow future concurrent execution. the floa ting - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. this instruction uses single - precision operands and it must not placed as delay instructions. a floating - point not a nu mber (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise only the invalid operation exception (at unordered). if the data type of two operands are different (unordered) the invalid operation exception is occurred. operation: result := ld - ls; z := ld = ls and not unordered; n := ld < ls or unordered; c := ld < ls and not unordered; v := unordered; if unordered then invalid operation exception exceptions: invalid operation.
appendix a. instruction set details a - 73 floating - point compare (double precision) fcmpd format: ll format op-code 1100 1001 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fcmpd ld, ls description: two operands are compared by subtracting the source operand form the destination operand and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the pre sent version, they are executed as software instructions. this instruction uses double - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise only the invalid operation exception (at unordered). if the data type of two operands are different (unordered) the invalid operati on exception is occurred. operation: result := ld//ldf - ls//lsf; z := ld//ldf = ls//lsf and not unordered; n := ld//ldf < ls//lsf or unordered; c := ld//ldf < ls//lsf and not unordered; v := unordered; if unordered then invalid operation exception; exceptions: invalid operation.
a - 74 appendix a. instruction set details floating - point compare without exception (single precision) fcmpu format: ll format op-code 1100 1010 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fcmpu ld, ls description: two operands are compared by subtracting the source operand form the destination operand and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. thi s instruction uses single - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for d ifferentiating a nan form a non - nan. this instruction can raise any exception. operation: result := ld - ls; z := ld = ls and not unordered; n := ld < ls or unordered; c := ld < ls and not unordered; v := unordered; - no exception exceptions: none.
appendix a. instruction set details a - 75 floating - point compare without exception (double precision) fcmpud format: ll format op-code 1100 1011 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fcmpud ld, ls description: two operands are c ompared by subtracting the source operand form the destination operand and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. this instruction uses double - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all o ther bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise only the invalid operation exception (at unordered). if the data type of two operands are different (unordered) the invalid operation exception is occ urred. operation: result := ld//ldf - ls//lsf; z := ld//ldf = ls//lsf and not unordered; n := ld//ldf < ls//lsf or unordered; c := ld//ldf < ls//lsf and not unordered; v := unordered; - no exception exceptions: none.
a - 76 appendix a. instruction set details floating - point convert (double => single) fcvt format: ll format op-code 1100 1100 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fcvt ld, ls description: the double - precision source operand (ls//lsf) is converted to the single - precision destination operand (ld) and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. this instruction uses single - precisi on operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - n an. this instruction can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. operation: ld := (ls//lsf) exceptions: invalid operation, division by zero, overflow, underflow or inexact.
appendix a. instruction set details a - 77 floating - point convert (single => doubl e) fcvtd format: ll format op-code 1100 1101 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fcvtd ld, ls description: the single - precision source operand (ls) is converted to the double - precision destination operand (ld//ldf) and all condition flags remain unchanged to allow future concurrent execution. t he floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. this instruction uses double - precision operands and it must not placed as delay instructions. a floating - point n ot a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise any of the exceptions invalid operation, divi sion by zero, overflow, underflow or inexact. operation: (ld//ldf) := ls; exceptions: invalid operation, division by zero, overflow, underflow or inexact.
a - 78 appendix a. instruction set details floating - point division (single precision) fdiv format: ll format op-code 1100 0110 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fdiv ld, ls description: the desti nation operand (ld) is divided by the source operand (ls), the result is placed in the destination register (ld) and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standa rd 754 - 1985. in the present version, they are executed as software instructions. this instruction uses single - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the o perand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. operation: ld := ld / ls exce ptions: invalid operation, division by zero, overflow, underflow or inexact.
appendix a. instruction set details a - 79 floating - point division (double precision) fdivd format: ll format op-code 1100 0111 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fdivd ld, ls description: the destination operand (ld//ldf) is divided by the source operand (ls //lsf), the result is placed in the destination register (ld//ldf) and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. this instruction uses double - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. operation: ld//ldf := ld//ldf / ls//lsf exceptions: invalid operation, division by zero, o verflow, underflow or inexact.
a - 80 appendix a. instruction set details fetch fetch format: rn format rd-code 1 (g1 = sr) 15 8 7 4 3 0 d = 0: rd-code encoded r0..r15 for rd d = 1: rd-code encoded l0..l15 for rd n: bit 8 // bits 3..0 encode n = 0..31 n d 0 n 9 10 op-code 1011 10 notation: fetch ld, ls description: the instruction execution is halted until a number of at least n/2 + 1 (n = 0, 2, 4, ..., 30) instruction halfwords succeeding the fetch instruction are prefetched in the instruction cache. the number of n/2 is derived by using bits 4..1 of n, bit 0 of n must be zero. the fetch instruction must not be placed as a delay instruction; when the preceding branch is taken, the prefetch is undefined. the fetch in struction shares the basic op - code setxx, it is differentiated by denoting the sr for the rd - code. operation: fetch 1 wait until 1 instruction halfword is fetched fetch 2 wait until 2 instruction halfwords are fetched ........ fetch 16 wait until 2 instruction halfwords are fetched exceptions: none.
appendix a. instruction set details a - 81 floating - point multiplication (single precision) fmul format: ll format op-code 1100 0100 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fmul ld, ls description: the source op erand (ls) and destination operand(ld) are multiplied, the result is placed in the destination register (ld) and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 7 54 - 1985. in the present version, they are executed as software instructions. this instruction uses single - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the opera nd word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. operation: ld := ld * ls exceptio ns: invalid operation, division by zero, overflow, underflow or inexact.
a - 82 appendix a. instruction set details floating - point multiplication (double precision) fmuld format: ll format op-code 1100 0101 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fmuld ld, ls description: the source operand (ls//lsf) and destination operand(ld//ldf) are mu ltiplied, the result is placed in the destination register (ld//ldf) and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they ar e executed as software instructions. this instruction uses double - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all oth er bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. operation: ld//ldf := ld//ldf *ls//lsf exceptions: invalid operation, division by zero, overflow, underflow or inexact.
appendix a. instruction set details a - 83 frame frame format: ll format op-code 1110 1101 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: frame ld, ls description: a frame instruction restructures the current stack frame by l decre asing the frame pointer fp to include (optionally) passed parameters in the local regi ster addressing range; the first parameter passed is then addressable as l0; l resetting the frame length fl to the actual number of registers needed for the current stack frame. the frame pointer fp is decre ased by the value of the ls - code and the ld - code i s placed in the frame length fl (fl = 0 is always interpreted as fl = 16). then the difference (available number of registers) - (required number of registers + 10) is evaluated and interpreted as a signed 7 - bit integer. if difference is not negative, all the registers required plus the reserve of 10 fit into the register part of the stack; no further action is needed and the frame instruction is finished. if difference is negative, the content of the old stack pointer sp is compared with the address in th e upper stack bound ub. if the value in the sp is equal or higher than the value in the ub, a temporary fl a g is set. then the contents of the number of local registers equal to the negative difference evaluated are pushed onto the memory part of the stack, beginning with the content of the local register addressed absolutely by sp(7..2) being pushed onto the location addressed by the sp. all condition flags remain unchanged. attention: the frame instruction must always be the first instruction executed in a entered by a call instruction, otherwise the frame instruction could be separated form the preceding call instruction by an interrupt, parity error, extended overflow of trace
a - 84 appendix a. instruction set details frame (continued) frame operation: fp := fp - ls-code; fl := ld code; m := 0; difference (6..0) := sp(8..2) + (64-16) - (fp + fl); if defference > 0 then continue at next instruction else temporary flag := sp > ub; repeat memory sp := register sp(7..2)^; sp := sp + 4; difference := difference + 1; until difference = 0; if temporary flag = 1 then trap => range error exceptions: range er ror exception.
appendix a. instruction set details a - 85 floating - point subtract (single precision) fsub format: ll format op-code 1100 0010 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fsub ld, ls description: the source operand (ls) is subtracted from the destination operand (ld), the result is placed in the destination register (ld) and all condition flags remain unchanged to allow future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. this instruction uses single - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise any of the exceptions invalid operation, division by zero, overflow, underflow or inexact. operation: ld := ld - ls exceptions: invalid operation, division by zero, overflow, underflow or inexact.
a - 86 appendix a. instruction set details floating - point subtract (double precision) fsubd format: ll format op-code 1100 0011 ld-code ls-code 15 8 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: fsubd ld, ls description: the source operand (ls//lsf) is subtracted from the destination operand (ld//ldf), the result is placed in the destination register (ld//ldf) and all condition flags remain unchanged to allo w future concurrent execution. the floating - point instructions comply with the ansi/ieee standard 754 - 1985. in the present version, they are executed as software instructions. this instruction uses double - precision operands and it must not placed as delay instructions. a floating - point not a number (nan) is encoded by bits 30..19 = all ones in the operand word containing the exponent; all other bits of the operand are ignored for differentiating a nan form a non - nan. this instruction can raise any of the ex ceptions invalid operation, division by zero, overflow, underflow or inexact. operation: ld//ldf := ld//ldf - ls//lsf exceptions: invalid operation, division by zero, overflow, underflow or inexact.
appendix a. instruction set details a - 87 load (absolute address mode) ldxx.a format: rrdis format op-code 1001 00 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: ldxx.a 0, r s, dis description: the load instruction of absolute address mode transfers data from the addressed memory location, displacement dis is used as an address, into a register rs or a register pair rs//rsf. the displacement dis is used as an address into memo ry address space. rd must denote the sr to differentiate this mode from the displacement address mode; the content of the sr is not used. data type xx is with bu: byte unsigned hu: halfword unsigned w: word bs: byte singed hs: halfword signed d: double - w ord operation: rs := dis^; [rsf := (dis+4)^; exceptions: none.
a - 88 appendix a. instruction set details load double word (post - increment address mode) ldd.p format: lr format op-code 1101 011 ld-code rs-code 15 8 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs ld-code encodes l0..l15 for ld s notation: ldd.p ld, rs description: the load instruction of post - increment address mode transfers data from the addressed memory location, ld is used as an address, into a register pair rs//rsf. the content of the destination register ld is used as an address into memory address space, then ld is incremented according to the specified data size of double - word memory instruction by 8, regardless of any exception occurring. ld is incremented by 8 at the first memory cycle. operation: rs := ld^; ld := ld + 4; rsf := (old ld + 4)^; exceptions: none.
appendix a. instruction set details a - 89 load double word (register address mode) ldd.r format: lr format op-code 1101 001 ld-code rs-code 15 8 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs ld-code encodes l0..l15 for ld s notation: ldd.r ld, rs description: the load instruction of register address mod e transfers data from the addressed memory location, ld is used as an address, into a register pair rs//rsf. the content of the destination register ld is used as an address into memory address space. operation: rs := ld^ rsf := (ld + 4)^; exceptions: none.
a - 90 appendix a. instruction set details load (displacement addre ss mode) ldxx.d format: rrdis format op-code 1001 00 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: ldxx.d rd, rs, dis description: the load instruction of displacement address mode transfers data from the addressed memory location, rd plus a signed dis is used as an address, into a register rs or a reg ister pair rs//rsf. the sum of the contents of the destination register rd plus a signed displacement dis is used as an address into memory address space. rd may denote any register except the sr; rd not denoting the sr differentiates this mode from the ab solute address mode. data type xx is with bu: byte unsigned hu: halfword unsigned w: word bs: byte singed hs: halfword signed d: double - word operation: rs := (rd + dis)^; [rsf := (rd + dis + 4)^; exceptions: none.
appendix a. instruction set details a - 91 load (i/o absolute address mode) ldxx.ioa format: rrdis format op-code 1001 00 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: ldxx.i oa 0, rs, dis description: the load instruction of i/o absolute address mode transfers data from the addressed memory location, dis is used as an address, into a register rs or a register pair rs//rsf. the displacement dis is used as an address into i/o a ddress space. rd must denote the sr to differentiate this mode from the i/o displacement address mode; the content of the sr is not used. data type xx is with w: word d: double - word operation: rs := dis^; [rsf := (dis+4)^; exceptions: none.
a - 92 appendix a. instruction set details load (i/o displacement address mode) ldxx. iod format: rrdis format op-code 1001 00 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: ldxx.iod rd, rs, dis description: the load instruction of i/o displacement address mode transfers data from the addressed memory location, rd plus a signed dis is used as an address, into a register rs or a register pair rs//rsf. the sum of the contents of the destination register rd plus a signed displacement dis is used as an i/o address into memory address space. rd may denote any register except the sr; rd not denoting the sr differentiates this mode from the i/o absolute address mode. data type xx is with w: word d: double - word operation: rs := (rd + dis)^; [rsf := (rd + dis + 4)^; exceptions: none.
appendix a. instruction set details a - 93 load (next address mode) ldxx.n format: rrdis format op-code 1001 01 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: ldxx.n rd, rs, dis description: the load instruction of next address mode transfers data from the addressed memory location, rd is used as an address, into a register rs or a register pair rs//rsf. the content of the destination register rd is used as an address into memory address space, then rd is incremented by the signed displacement dis r egardless of any excep tion occurring. at a double - word data type, rd is incremented at the first memory cycle. rd must not denote the pc or the sr. in the case of all data types except byte, bit zero of dis is treated as zero for the calculation of rd + d is. data type xx is with bu: byte unsigned hu: halfword unsigned w: word bs: byte singed hs: halfword signed d: double - word operation: rs := rd^; rd := rd + dis [rsf := (old rd + 4)^]; exceptions: none.
a - 94 appendix a. instruction set details load word (post - increment address mode) ldw.p format: lr format op-code 1101 010 ld-code rs-code 15 8 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs ld-code encodes l0..l15 for ld s notation: ldw.p ld, rs descript ion: the load instruction of post - increment address mode transfers data from the addressed memory location, ld is used as an address, into a register rs. the content of the destination register ld is used as an address into memory address space, then ld is incremented according to the specified data size of a word by 4, regardless of any exception occurring. operation: rs := ld^; ld := ld + 4; exceptions: none.
appendix a. instruction set details a - 95 load word (register address mode) ldw.r format: lr format op-code 1101 000 ld-code rs-code 15 8 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs ld-code encodes l0..l15 for ld s notation: ldw.r ld, rs description: the load instruction of register address mode transfers data from the addressed memory location, ld is used as an address, into a register rs. the content of the destination register ld is used as an address into memory address space. operation: rs := ld^; exceptions: none.
a - 96 appendix a. instruction set details load word ( stack address mode) ldw.s format: rrdis format op-code 1001 01 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: ldw.s rd, rs, dis description: the load instruction of stack address mode transfers data from the addressed memory location, ld is used as an address, into a register rs. the content of the dest ination register rd is used as stack address, then rd is in cremented by dis regardless of any exception occurred. operation: rs := rd^; rd := rd + dis; exceptions: none.
appendix a. instruction set details a - 97 mask mask format: rrconst format op-code 0001 01 rd-code rs-code 15 8 7 4 3 0 cosnt2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: const = 18s // const1 (range -16,384..16,383) e = 1: const = 2s // const1 // const2 (range -1,073,741,824...1,073,741,823) e const1 s d s notation: mask rd, rs, const description: the result of a bitwise logica l and of the source operand and the immediate operand is placed in the destination register and the z flag is set or cleared accordingly. all operands and the result are interpreted as bit - string of 32 bits each. operation: rs := rd and const; z := rd = 0; exceptions: none.
a - 98 appendix a. instruction set details move word mov format: rr format rd-code rs-code op-code 0010 01 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: mov rd, rs description: the source operand is copied to the destination register and condition flags are set or cleared accordingly. operation: rd := rs; z := rd = 0; n := rd(31); v := undefined exceptions: none.
appendix a. instruction set details a - 99 move double word movd format: rr format rd-code rs-code op-code 0000 01 d s 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation : movd rd, rs movd rd, 0 (when sr is denoted as a source operand) description: the double - word source operand is copied to the double - word destination register pair and condition flags are set or cleared accordingly. the high - order word in rs is copied first. when the sr is denoted as a source operand, the source operand is supplied as zero regardless of the content of sr//g2. when the pc is denoted as destination, the return instruction ret is executed instead of the move double - word instruction. operat ion: if rd does not denote pc and rs does not denote sr then rd := rs; rdf := rsf; z := rd//rsf = 0; n := rd(31); v := undefined if rd does not denote pc and rs denotes sr then rd := 0; rdf := 0; z := 1; n := 0; v := undefined exceptions: none.
a - 100 appendix a. instruction set details move word immediate movi format: rimm format 15 8 7 4 3 0 imm2 d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd n: bit 8 // bits 3..0 encode n = 0..31, see table 2.3 encoding of immediate values for encoding of imm imm1 op-code 0110 01 rd-code n d n notation: movi rd, imm description: the immediate operand is copied to the destination register and condition flags are set or cleared accordingly. operation: rs := imm; z := rd = 0; n := rd(31); v := 0; exceptions: none.
appendix a. instruction set details a - 101 multiply word mul format: rr format op-code 1011 11 rs-code s d rd-code 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: mul rd, rs description: the source operand and the destination operand are multiplied, the low - order word of the product is placed in the destination register (the high - order product word is not evaluate d) and the condition flags are set or cleared according to the single - word product. both operands are either signed or unsigned integers, the product is a single - word integer. the result is undefined if the pc or the sr is denoted. operation: rs := low order word of product rd * rs; z := sinlgeword product = 0; n := rd(31); - sing of singleword product; - valid for singed operands; v := undefined; c := undefined; exceptions: none.
a - 102 appendix a. instruction set details multiply signed double - word muls format: rr format op-code 1011 01 rs-code s d rd-code 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: muls rd, rs description: the source operand and the destination operand are multiplied, the double - word product is placed in the destination register pair (the destination register expanded by the register following it) and the condition flags are set or cleared according to the double - word product. both operands are signed integers and the product is a signed double - word integer. the result is undefined if the pc or the sr is denote d. operation: rs//rdf := signed doubleword product rd * rs; z := rd//rdf = 0; - doubleword product is zero n := rd(31); - doubleword product is negative v := undefined; c := undefined; exceptions: none.
appendix a. instruction set details a - 103 multiply unsigned double - word mulu format: rr format op-code 1011 00 rs-code s d rd-code 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: mulu rd, rs description: the source operand and the destination operand are multiplied, the double - word product is placed in the destination register pa ir (the destination register expanded by the register following it) and the condition flags are set or cleared according to the double - word product. both operands are unsigned integers and the product is a unsigned double - word integer. the result is undefi ned if the pc or the sr is denoted. operation: rs//rdf := unsigned doubleword product rd * rs; z := rd//rdf = 0; - doubleword product is zero n := rd(31); v := undefined; c := undefined; exceptions: none.
a - 104 appendix a. instruction set details negate (unsigned or unsigned) neg format: rr format op-code 0101 10 rs-code s d rd-code 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: neg rd, rs neg rd, c (when sr is denoted as a rs) description: the source operand (rs) is subtracted from zero, the re sult is placed in the destination register (rd) and the condition flag are set or cleared accordingly. both operands and the result are interpreted as either all signed or all unsigned integers. when the sr is denoted as a source operand, carry flag c is n egated instead of the sr. operation: when rs is sr rd := - c; z := rd = 0; n := rd(31); v := overflow; c := carry; if c is set then rd := -1; else rd := 0; when rs is not sr rd := - rs; z := rd = 0; n := rd(31); v := overflow; c := carry; exceptions: none.
appendix a. instruction set details a - 105 negate (signed) negs format: rr format op-code 0101 11 rs-code s d rd-code 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: negs rd, rs negs rd, c (when sr is denoted as a rs) description: the source operand (rs) is subtracted from zero, the result is placed in the destination register (rd) and the condition flag are set or cleared accordingly. both operands and the result are interpreted as all signed. when the sr is denoted as a source operand, carry flag c is negated instead of the sr. operation: when rs is sr rd := - c; z := rd = 0; n := rd(31); v := overflow; c := carry; if c is set then rd := -1; else rd := 0; when rs is not sr rd := - rs; z := rd = 0; n := rd(31); v := overflow; if overflow then trap => range error exceptions: o verflow: range error.
a - 106 appendix a. instruction set details no operation nop format: rr format op-code 0000 00 rs-code (l0) 0000 s 1 d 1 rd-code (l0) 0000 15 10 9 8 7 4 3 0 notation: nop description: the instruction chk l0, l0 cannot cause any trap. since chk leaves all registers and condition flags unchanged, it can be used as a no operation instruction. operation : none. exceptions: none.
appendix a. instruction set details a - 107 invert not format: rr format op-code 0100 01 rs-code s d rd-code 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: not rd, rs description: the source operand (rs) is placed bitwise inverted in the designation register and the z flag is set or cleared accordingly. the source operand and the result ar e interpreted as bit - strings of 32 bits each. operation: rd := not rs; z := rd = 0; exceptions: none.
a - 108 appendix a. instruction set details or or format: rr format op-code 0011 10 rs-code s d rd-code 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: or rd, rs description: the result of a bitwise logical or of the source operand and the destination operand is placed in the destination r egister and the z flag is set or cleared accordingly. all operands and the result are interpreted as bit - strings of 32 bits each. operation: rs := rd or rs; z := rd = 0; exceptions: none.
appendix a. instruction set details a - 109 or immediate ori format: rimm format 15 8 7 4 3 0 imm2 d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd n: bit 8 // bits 3..0 encode n = 0..31, see table 2.3 encoding of immediate values for encoding of imm imm1 op-code 0111 10 rd-code n d n notation: ori rd, imm description: the result of a bitwise logical or of the immediate operand and the destination operand is placed in the destination register and the z flag is set or cleared accordingly. all operands and the result are interpreted as bit - strings of 32 bits each. operation: rs := rd or imm; z := rd = 0; exception s: none.
a - 110 appendix a. instruction set details return ret format: rr format op-code 0000 01 rs-code s d rd-code 15 10 9 8 7 4 3 0 s = 0: rs-code encoded g0..g15 for rs s = 1: rs-code encoded l0..l15 for rs d = 0: rd-code encoded g0..g15 for rd d = 1: rd-code encoded l0..l15 for rd notation: ret pc, rs description: the return instruction returns control from a subprogram entered through a call, trap or software instruction or an exception to the instruction located at the return address an d restores the status from the saved return status. the source operand pair rs//rsf is placed in the register pair pc//sr. the program counter pc is restored first from rs. then all bits of the status register sr are replaced by rsf; except the supervisor flag s, which is restored from bit zero of rs and except the instruction length code ilc, which is cleared to zero. the return instruction shares its basic op - code with the move double - word instruction. it is differentiated from it by denoting the pc as de stination register rd. operation: old s := s; old l := l; pc := rs(31..1)//0; sr := rs(31..32)//00//rs(0)//rsf(17..0); - ilc := 0; s := rs(0); if ( old s = 0 and s = 1) or ( s=0 and old l= 0 and l = 1 ) then trap => privilege error; difference(6..0) := fp - sp(8..2); - difference is signed, difference(6) = sign bit if difference > 0 then continue at next instructio; else repeat sp := sp -4; register sp(7..2)^ := memory sp^; difference := difference + 1; until difference = 0; exceptions: privilege error.
appendix a. instruction set details a - 111 rotate left rol format: ll format op-code 1000 1111 ls-code ld-code 15 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: rol ld, ls description: the destination operand is shifted left by a number of bit positions and the bits shifted out are inserted in the va cated bit positions; thus, the destination operand is rotated. the condition flags are set or cleared accordingly. bits 4..0 of the source operand specify a rotation by 0..31 bit positions; bits 31..5 of the source operand are ignored. operation: ld := ld rotated left by ls(4..0); z := ld = 0; n := ld(31); v := undefined; c := undefined; excepti ons: none.
a - 112 appendix a. instruction set details shift right (signed single word) sar format: ll format op-code 1000 0111 ls-code 15 7 4 3 0 ld-code ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: sar ld, ls description: the destination operand is shifted right by a number of bit positions specified by bits 4..0 of the source operand as a shift by 0..31. the higher - or der bits of the source operand are ignored. the destination operand is interpreted as a signed integer. the shift right instruction inserts sign bits in the vacated bit positions at the left. operation: ld := ld >> by ls(4..0); z := ld =0; n := ld(31); c := last bit shifted out is "one" exceptions: none.
appendix a. instruction set details a - 113 shift right (signed double word ) sard format: ll format op-code 1000 0110 ls-code 15 7 4 3 0 ld-code ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: sard ld, ls description: the destination operand is shifted right by a number of bit positions specified by bits 4..0 of the source operand as a shift by 0..31. the higher - order bits of the source operand are ignored . the destination operand is interpreted as a signed double - word integer. the shift right instruction inserts sign bits in the vacated bit positions at the left. the double - word shift right instruction executes in two cycles. the high - order operand in ld i s shifted first. the result is undefined if ls denotes the same register as ld or ldf. operation: ld//ldf := ld//ldf >> by ls(4..0); z := ld//ldf =0; n := ld(31); c := last bit shifted out is "one" exceptions: none.
a - 114 appendix a. instruction set details shift right immediate (signed double word) sardi format: ln format op-code 1000 010 n n 15 7 4 3 0 ld-code encodes l0..l15 for ld n: bit 8//bit 3..0 encode n = 0..31 ld-code 8 9 notation: sardi ld, n description: the destination operand is sh ifted right by a number of bit positions specified by n = 0..31 as a shift by 0..31. the destination operand is interpreted as a signed double - word integer. the shift right instruction inserts sign bits in the vacated bit positions at the left. the double - word shift right instruction executes in two cycles. the high - order operand in ld is shifted first. the result is undefined if ls denotes the same register as ld or ldf. operation: ld//ldf := ld//ldf >> by n; z := ld//ldf = 0; n := ld(31); c := last bit shifted out is "one" exceptions: none.
appendix a. instruction set details a - 115 shift right immediate (signed single word) sari form at: rn format op-code 1010 01 n n 15 7 4 3 0 d = 0: rd-code encodes g0..g15 for rd d = 1: rd-code encodes l0..l15 for rd n: bit 8//bit 3..0 encode n = 0..31 rd-code 8 9 d notation: sari ld, n description: the destination operand is shifted right by a number of bit positions specified by n = 0..31 as a shift by 0..31. the destination operand is interpreted as a signed integer. the shift right instruction in serts sign bits in the vacated bit positions at the left. operation: ld := ld >> by n; z := ld/ = 0; n := ld(31); c := last bit shifted out is "one" exceptions: none.
a - 116 appendix a. instruction set details shift left (single word) shl format: ll format op-code 1000 1011 ls-code 15 7 4 3 0 ld-code encodes l0..l15 for ld ls-code encodes l0..l15 for ls ld-code 8 notation: shl ld, ls description: the destination operand is shifted left by a number of bit positions specified by bits 4..0 of the source operand as a shift by 0..31. the higher - order bits of the source operand are ignored. the destination operand is interpreted as a signed or unsigned integer. the shift left instruction inserts zeros in the vacated bit positions a t the right. operation: ld := ld << by ls(4..0); z := ld = 0; n := ld(31); c := undefined; v := undefined; exceptions: none.
appendix a. instruction set details a - 117 shift left (double word) shld format: ll format op-code 1000 1010 ls-code 15 7 4 3 0 ld-code encodes l0..l15 for ld ls-code encodes l0..l15 for ls ld-code 8 notation: shld ld, ls description: the destination operand is shifted left by a number of bit positions specified by bits 4..0 of the source operand as a shi ft by 0..31. the higher - order bits of the source operand are ignored. the destination operand is interpreted as a signed or unsigned double - word integer. the shift left instruction inserts zeros in the vacated bit positions at the right. the double - word sh ift left instruction executes in two cycles. the high - order operand in ld is shifted first. the result is undefined if ls denotes the same register as ld or ldf. operation: ld//ldf := ld//ldf << by ls(4..0); z := ld//ldf = 0; n := ld(31); c := undefined; v := undefined; exceptions: none.
a - 118 appendix a. instruction set details shift left immediate (double word) shldi format: ln format op-code 1000 100 n 15 7 4 3 0 ld-code encodes l0..l15 for ld n: bit 8//bit 3..0 encode n = 0..31 ld-code 8 n 9 notation: shldi ld, n description: the destination operand is shifted left by a number of bit positions specified by n = 0..31 as a shift by 0..31. the destination operand is interpreted as a signed or unsigned double - word integer. the shift left instru ction inserts zeros in the vacated bit positions at the right. the double - word shift left instruction executes in two cycles. the high - order operand in ld is shifted first. the result is undefined if ls denotes the same register as ld or ldf. operation: ld//ldf := ld//ldf << by n; z := ld//ldf = 0; n := ld(31); c := undefined; v := undefined; exceptions: none.
appendix a. instruction set details a - 119 shift left immediate (single word) shli format: rn format op-code 1010 10 n n 15 7 4 3 0 d = 0: rd-code encodes g0..g15 for rd d = 1: rd-code encodes l0..l15 for rd n: bit 8//bit 3..0 encode n = 0..31 rd-code 8 9 d notation: shli ld, n description: the destination operand is shifted left by a number of bit positions specified by n = 0..31 as a shift by 0..31. the destination operand is interpreted as a signed or unsigned integer. the shift left instruction inserts zeros in the vacated bit positions at the right. operation: ld := ld << by n; z := ld = 0; n := ld(31); c := undefined; v := undefined; exceptions: none.
a - 120 appendix a. instruction set details shift right (unsigned single word) shr format: ll format op-code 1000 0011 ls-code 15 7 4 3 0 ld-code encodes l0..l15 for ld ls-code encodes l0..l15 for ls ld-code 8 notation: shr ld, ls descriptio n: the destination operand is shifted right by a number of bit positions specified by bits 4..0 of the source operand as a shift by 0..31. the higher - order bits of the source operand are ignored. the destination operand is interpreted as a unsigned integer . the shift right instruction inserts zeros in the vacated bit positions at the left. operation: ld := ld >> by ls(4..0); z := ld =0; n := ld(31); c := last bit shifted out is "one" exceptions: none.
appendix a. instruction set details a - 121 shift right (unsigned double word) shrd format: ll format op-code 1000 0010 ls-code 15 7 4 3 0 ld-code encodes l0..l15 for ld ls-code encodes l0..l15 for ls ld-code 8 notation: shrd ld, ls description: the destination operand is shifted righ t by a number of bit positions specified by bits 4..0 of the source operand as a shift by 0..31. the higher - order bits of the source operand are ignored. the destination operand is interpreted as a unsigned double - word integer. the shift right instruction inserts zeros in the vacated bit positions at the left. the double - word shift right instruction executes in two cycles. the high - order operand in ld is shifted first. the result is undefined if ls denotes the same register as ld or ldf. operation: ld//ldf := ld//ldf >> by ls(4..0); z := ld//ldf =0; n := ld(31); c := last bit shifted out is "one" except ions: none.
a - 122 appendix a. instruction set details shift right immediate (unsigned double word) shrdi format: ln format op-code 1000 000 n 15 7 4 3 0 ld-code encodes l0..l15 for ld n: bit 8//bit 3..0 encode n = 0..31 ld-code 8 n 9 notation: shrdi ld, n description: the destination operand is shifted right by a number of bit positions specified by n = 0..31 as a shift by 0..31. the destination ope rand is interpreted as a unsigned double - word integer. the shift right instruction inserts zeros in the vacated bit positions at the left. the double - word shift right instruction executes in two cycles. the high - order operand in ld is shifted first. the re sult is undefined if ls denotes the same register as ld or ldf. operation: ld//ldf := ld//ldf >> by n; z := ld//ldf = 0; n := ld(31); c := last bit shifted out is "one" exceptions: none.
appendix a. instruction set details a - 123 shift right immediate (unsigned single word) shri format: rn format op-code 1010 00 n n 15 7 4 3 0 d = 0: rd-code encodes g0..g15 for rd d = 1: rd-code encodes l0..l15 for rd n: bit 8//bit 3..0 encode n = 0..31 rd-code 8 9 d notation: shri ld, n description: the destination operand is shifted right by a number of bit positions specified by n = 0..31 as a shift by 0..31. the destination operand is interpreted as a unsigned integer. the shift right instruction inserts zeros in the vacated bit positions at the left. operation: ld := ld >> by n; z := ld/ = 0; n := ld(31); c := last bit shifted out is "one" exceptions: none.
a - 124 appendix a. instruction set details set stack addre ss setadr format: rn format op-code 1011 10 n 0000 d 15 7 4 3 0 d = 0: rd-code encodes g0..g15 for rd d = 1: rd-code encodes l0..l15 for rd n: bit 8 // bits 3..0 encode n = 0..31 n 0 rd-code notation: setadr rd description: the set stack address instruction calculates the stack address of the beginning of the current stack frame. l0..l15 of this frame can then be addressed relative to this stack address in the stack address mode with displacement values of 0..60 respectively. the frame pointer fp is placed, expanded to the stack address, in the destination register. the fp itself and all condition flags remain unchanged. the expanded fp address is the address at which the content of l0 would be stored if pushed onto the memory part of the stack. the set stack address instruction shares the basic op - code setxx, it is differentiated by n = 0 and not denoting the sr or the pc. operation: rd := sp(31..9) // sr(31..25) // 00 + carry into bit 9 - sr(31..25) is fp - carry into bit 9 := ( sp(8)=1 and sr(31)=0 ) exceptions: none.
appendix a. instruction set details a - 125 set co nditional instruction setxx format: rn format op-code 1011 10 n d 15 7 4 3 0 d = 0: rd-code encodes g0..g15 for rd d = 1: rd-code encodes l0..l15 for rd n: bit 8 // bits 3..0 encode n = 0..31 n rd-code notation: setxx rd description: the destination register is set or cleared according to the states of the condition flags specified by n. the condition flags themselves remain unchanged. the set conditiona l instruction share the basic op - code setxx, they are differentiated by n = 1..31 and not denoting the sr or the pc. l n = 0 while not denoting the sr or the pc differentiates the set stack address instruction. l n = 1..31 while not denoting the sr or the pc d ifferentiates the set conditional instruction. l denoting the sr differentiates the fetch instruction. l denoting the pc is reserved for future use. operation: n notation or alternative operation 1 reserved 2 set1 rd rd := 1; 3 set0 rd rd := 0; 4 setl e rd if n = 1 or z = 1 then rd := 1 else rd := 0; 5 setgt rd if n = 0 and z = 0 then rd := 1 else rd := 0; 6 setlt rd setn rd if n = 1 then rd := 1 else rd := 0; 7 setge rd setnn rd if n = 0 then rd := 1 else rd := 0; 8 setse rd if c = 1 or z = 1 then rd := 1 else rd := 0; 9 setht rd if c = 0 and z = 0 then rd := 1 else rd := 0; 10 setst rd setc rd if c = 1 then rd := 1 else rd := 0;
a - 126 appendix a. instruction set details set conditional instruction (continued) setxx n notation or alternative operation 11 sethe rd setnc r d if c = 0 then rd := 1 else rd := 0; 12 sete setz if z = 1 then rd := 1 else rd := 0; 13 setne setnz if z = 0 then rd := 1 else rd := 0; 14 setv rd if v = 1 then rd := 1 else rd := 0; 15 setnv rd if v = 0 then rd := 1 else rd := 0; 16 reserved 1 7 reserved 18 set1m rd rd := - 1; 19 reserved 20 setlem rd if n = 1 or z = 1 then rd := - 1 else rd := 0; 21 setgtm rd if n = 0 and z = 0 then rd := - 1 else rd := 0; 22 setltm rd setnm rd if n = 1 then rd := - 1 else rd := 0; 23 setgem rd setnn m rd if n = 0 then rd := - 1 else rd := 0; 24 setsem rd if c = 1 or z = 1 then rd := - 1 else rd := 0; 25 sethtm rd if c = 0 and z = 0 then rd := - 1 else rd := 0; 26 setstm rd setcm rd if c = 1 then rd := - 1 else rd := 0; 27 sethem rd setncm rd if c = 0 then rd := - 1 else rd := 0; 28 setem setzm if z = 1 then rd := - 1 else rd := 0; 29 setnem setnzm if z = 0 then rd := - 1 else rd := 0; 30 setvm rd if v = 1 then rd := - 1 else rd := 0; 31 setnvm rd if v = 0 then rd := - 1 else rd := 0; except ions: none.
appendix a. instruction set details a - 127 store (absolute address mode) stxx.a format: rrdis format op-code 1001 10 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: stxx.a 0, rs, dis description: the store instruction of absolute address mode transfers data from a register rs or a register pair rs//rsf into the addressed memory locat ion, displacement dis is used as an address. the displacement dis is used as an address into memory address space. rd must denote the sr to differentiate this mode from the displacement address mode; the content of the sr is not used. data type xx is with bu: byte unsigned hu: halfword unsigned w: word bs: byte singed hs: halfword signed d: double - word operation: dis^ := rs; [(dis+4)^ := rsf;] exceptions: none.
a - 128 appendix a. instruction set details store double word (post - increment address mode) std.p format: lr format op-code 1101 111 ld-code rs-code 15 8 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs ld-code encodes l0..l15 for ld s notation: std.p ld, rs description: the store i nstruction of post - increment address mode transfers data from a register pair rs//rsf into the addressed memory location, ld is used as an address. the content of the destination register ld is used as an address into memory address space, then ld is incre mented according to the specified data size of double - word memory instruction by 8, regardless of any exception occurring. ld is incremented by 8 at the first memory cycle. operation: ld^ := rs; ld := ld +size; (old ld + 4)^ := rsf; exceptions: none.
appendix a. instruction set details a - 129 store double word (register address mode) std.r for mat: lr format op-code 1101 101 ld-code rs-code 15 8 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs ld-code encodes l0..l15 for ld s notation: std.r ld, rs description: the store instruction of register address mode transfers data from a register pair rs//rsf into the addressed memory location, ld is used as an address. the content of the destination register ld is us ed as an address into memory address space. operation: ld^ := rs; (ld + 4)^ := rsf; exceptions: none.
a - 130 appendix a. instruction set details store (displacement address mode) stxx.d format: rrdis format op-code 1001 10 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: stxx.d rd, rs, dis description: the store instruction of displacement address mode transfers data from a register rs or a register pair rs//rsf. into the addressed memory location, rd plus a signed dis is used as an address. the sum of the contents of the destination register rd plus a signed displacement dis is used as an address into memory address space. rd may denote any register except the sr; rd not denoting the sr differentiates this mode from the absolute address mode. data type xx is with bu: byte unsigned hu: halfword unsigned w: word bs: byte singed hs: halfword signed d: double - word operation: (rd + dis)^ := rs; [(rd + dis +4)^ := rsf;] exceptions: none.
appendix a. instruction set details a - 131 store (i/o absolute address mode) stxx.ioa format: rrdis format op-code 1001 10 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: stxx.ioa 0, rs, dis description: the store instruction of i/o absolute address mode transfers data from a register rs or a register pair rs//rsf into the addre ssed memory location, dis is used as an address. the displacement dis is used as an address into i/o address space. rd must denote the sr to differentiate this mode from the i/o displacement address mode; the content of the sr is not used. data type xx is with w: word d: double - word operation: dis^ := rs; [(dis +4)^ := rsf;] exceptions: none.
a - 132 appendix a. instruction set details store (i/o displacement address mode) stxx.iod format: rrdis format op-code 1001 10 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: stxx.iod rd, rs, dis description: the store instruction of i/o displacement address mode transfers data from a re gister rs or a register pair rs//rsf. into the addressed memory location, rd plus a signed dis is used as an address. the sum of the contents of the destination register rd plus a signed displacement dis is used as an i/o address into memory address space. rd may denote any register except the sr; rd not denoting the sr differentiates this mode from the i/o absolute address mode. data type xx is with w: word d: double - word operation: (rd + dis)^ := rs; [(rd + dis +4)^ := rsf;] exceptions: none.
appendix a. instruction set details a - 1 33 store (next address mode) stxx.n format: rrdis form at op-code 1001 11 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: stxx.n rd, rs, dis description: the store instruction of next address mode transfers data from a register rs or a register pair rs//rsf into the addressed memory location, rd is used as an address. the content of the destination register rd is used as an address into memory address space, then rd is incremented by the signed displacement dis regardless of any excep tion occurring. at a double - word data type, rd is incremented at the first memory cycle. rd must not denote the pc or the sr. in the case of all data types except byte, bit zero of dis is treated as zero for the calculation of rd + dis. data type xx is with bu: byte unsigned hu: halfword unsigned w: word bs: byte singed hs: halfword signed d: double - word operation: rd^ := rs; rd := rd + dis; [(old rd +4)^ := rsf;] exceptions: n one.
a - 134 appendix a. instruction set details store word (post - increment address mode) stw.p format: lr format op-code 1101 110 ld-code rs-code 15 8 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs ld-code encodes l0..l15 for ld s notation: stw.p ld, rs description: the store instruction of post - increment address mode transfers data from a register rs into the addressed memory location, ld is used as an addre ss. the content of the destination register ld is used as an address into memory address space, then ld is incremented according to the specified data size of a word by 4, regardless of any exception occurring. operation: ld^ := rs; ld := ld + 4; exceptions: none.
appendix a. instruction set details a - 135 store word (re gister address mode) stw.r format: lr format op-code 1101 100 ld-code rs-code 15 8 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs ld-code encodes l0..l15 for ld s notation: stw.r ld, rs description: the store instruction of register address mode transfers data from into a register rs into the addressed memory location, ld is used as an address. the content of the des tination register ld is used as an address into memory address space. operation: ld^ := rs; exceptions: none.
a - 136 appendix a. instruction set details store word (stack address mode) stw.s format: rrdis format op-code 1001 11 rd-code rs-code 15 8 7 4 3 0 dis2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: dis = 20s // dis1(range -4,096..4,095) e = 1: dis = 4s // dis1 // dis2 (range -268,435,456...268,435,455) dd: d-code, d13..d12 encode data types at memory instructions e dis1 s d s dd notation: stw.s rd, rs, dis description: the store instruction of stack address mode transf ers data from into a register rs into the addressed memory location, ld is used as an address. the content of the destination register rd is used as stack address, then rd is in cremented by dis regardless of any exception occurred. operation: rd^ := rs; rd := rd + dis; exceptions : none.
appendix a. instruction set details a - 137 subtract sub format: rr format op-code 0100 10 rs-code d 15 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd d = 1: rd-code encodes l0..l15 for rd s rd-code 8 9 notation: sub rd, rs sub rd, c (when sr is denoted as a source operand) description: the source operand is subtracted form the destination operand, the result is placed in the destination register and the conditi on flags are set or cleared accordingly. both operands and the result are interpreted as either all signed or all unsigned integers. when the sr is denoted as a source operand, c is subtracted instead of the sr. operation: when rs does not denote sr rd := rd - rs; z := rd = 0; n := rd(31); v := overflow; c := borrow; when rs denotes sr rd := rd - c; z := rd = 0; n := rd(31); v := overflow; c := borrow; exceptions: none.
a - 138 appendix a. instruction set details subtract with borrow subc format: rr format op-code 0100 00 rs-code d 15 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd d = 1: rd-code encodes l0..l15 for rd s rd-code 8 9 notation: subc rd, rs subc rd, c (when sr is denoted as a source operand) description: the source operand + c is subtracted form the destination operand, the result is placed in the destination register and the condit ion flags are set or cleared accordingly. both operands and the result are interpreted as either all signed or all unsigned integers. when the sr is denoted as a source operand, c is subtracted instead of the sr. operation: when rs does not denote sr rd := rd - (rs + c); z := z and (rd = 0); n := rd(31); v := overflow; c := borrow; when rs denotes sr rd := rd - c; z := z and (rd = 0); n := rd(31); v := overflow; c := borrow; exceptions: none.
appendix a. instruction set details a - 139 signed subtr act with trap subs format: rr format op-code 0100 11 rs-code d 15 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd d = 1: rd-code encodes l0..l15 for rd s rd-code 8 9 notation: subs rd, rs subs rd, c (when sr is denoted as a source operand) description: the source operand is subtracted form the destination operand, the result is placed in the destination register and the cond ition flags are set or cleared accordingly. both operands and the result are interpreted as all signed integers and a trap to range error occurs at overflow. when the sr is denoted as a source operand, c is subtracted instead of the sr. operation: when rs does not denote sr rd := rd - rs z := rd = 0; n := rd(31); v := overflow; if overflow then trap => range error when rs denotes sr rd := rd - rs; z := rd = 0; n := rd(31); v := overflow; if overflow then trap => range error except ions: overflow (trap to range error).
a - 140 appendix a. instruction set details sum sum format: rrconst format op-code 0001 10 rd-code rs-code 15 8 7 4 3 0 cosnt2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: const = 18s // const1 (range -16,384..16,383) e = 1: const = 2s // const1 // const2 (range -1,073,741,824...1,073,741,823) e const1 s d s notation: sum rd, rs, const sum rd, c, const (when sr is denoted as a source operand) description: the sum of the source operand is placed in the destination register and the cond ition flags are set or cleared accordingly. both operands and the result are interpreted as either all signed or all unsigned integers. when the sr is denoted as a source operand, c is added instead of the sr. operation: when rs does not denote sr rd := rs + const; z := rd = 0; n := rd(31); v := overflow; c := carry; when rs denotes sr rd := c + const; z := rd = 0; n := rd(31); v := overflow; c := carry; exceptions: none.
appendix a. instruction set details a - 141 signed sum wit h trap sums format: rrconst format op-code 0001 11 rd-code rs-code 15 8 7 4 3 0 cosnt2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd s : sign bit of dis, e = 0: const = 18s // const1 (range -16,384..16,383) e = 1: const = 2s // const1 // const2 (range -1,073,741,824...1,073,741,823) e const1 s d s notation: sums rd, rs, const sums rd, c, const (when sr is denoted as a source operand) description: the sum of the source operand is placed in the destination register and the condition flags are set or cleared a ccordingly. both operands and the result are interpreted as all signed integers and a trap to range error occurs at overflow. when the sr is denoted as a source operand, c is added instead of the sr. operation: when rs does not denote sr rd := rs + const; z := rd = 0; n := rd(31); v := overflow; if overflow then trap => range error when rs denotes sr rd := c + const; z := rd = 0; n := rd(31); v := overflow; if overflow then trap => range error exceptions: overflow (trap to range error) .
a - 142 appendix a. instruction set details test leading zeros testlz format: ll format op-code 1000 1110 ls-code ld-code 15 7 4 3 0 ls-code encodes l0..l15 for ls ld-code encodes l0..l15 for ld notation: testlz ld, ls description: the number of leading zeros in the source operand is tested and placed in the destination register. a source operand equal to zero yields 32 as a result. all condition flags remain unchanged. operation: ld := number of leading zeros in ls; exceptions: none.
appendix a. instruction set details a - 143 trap trapxx format: pcadr format op-code 1111 1101 adr-byte 15 7 0 adr = 24 ones's // adr-byte(7..2) // 00; 8 notation: trapxx trapno description: the trap instructions trap and any of the conditional trap instructions when the trap condition is met, cause a branch to one out of 64 supervisor subprogram entries (see section 2.4. entry tables ). when the trap condition is not met, instruction execution proceeds sequentially. when the subprogram branch is taken, the subprogram entry address adr is placed in the program counte r pc and the supervisor - state flag s is set to one. the old pc containing the return address is saved in the register addressed by fp + fl; the old s flag is also saved in bit zero of this register. the old status register sr is saved in the register addre ssed by fp + fl + 1 (fl = 0 is interpreted as fl = 16); the saved instruction - length code ilc contains the length (1) of the trap instruction. then the frame pointer fp is incremented by the old frame length fl and fl is set to six, thus creating a new sta ck frame. the cache - mode flag m and the trace - mode flag t are cleared, the interrupt - lock flag l is set to one. all condition flags remain unchanged. then instruction execution proceeds at the entry address placed in the pc. the trap instructions are diffe rentiated by the 12 code values given by the bits 9 and 8 of the op - code and bits 1 and 0 of the adr - byte (code = op(9..8)//adr - byte(1..0)). since op(9..8) = 0 does not denote trap instructions (the code is occupied by the br instruction), trap codes 0..3 are not available.
a - 144 appendix a. instruction set details trap (continued) trapxx operation: code notation operation 4 traple trapno if n = 1 or z = 1 then execute trap else execute next instruction; 5 trapgt trapno if n = 0 and z = 0 then execute trap else execute next instruction; 6 t raplt trapno if n = 1 then execute trap else execute next instruction; 7 trapge trapno if n = 0 then execute trap else execute next instruction; 8 trapse trapno if c = 1 or z = 1 then execute trap else execute next instruction; 9 trapht trapno if c = 0 and z = 0 then execute trap else execute next instruction; 10 trapst trapno if c = 1 then execute trap else execute next instruction; 11 traphe trapno if c = 0 then execute trap else execute next instruction; 12 trape trapno if z = 1 then execute trap else execute next instruction; 13 trapne trapno if z = 0 then execute trap else execute next instruction; 14 trapv trapno if v = 1 then execute trap else execute next instruction; 15 trap trapno pc := adr; s := 1; (fp + fl)^ := old pc(31. .1)//old s; (fp + fl + 1)^ := old sr; fp := fp + fl; -- fl = 0 is treated as fl = 16 fl := 6; m := 0; t := 0; l := 1; trapno indicates one of the traps 0..63. exceptions: none.
appendix a. instruction set details a - 145 index move xmx format: rrlim format 15 8 7 4 3 0 lim2 s = 0: rs-code encodes g0..g15 for rs, s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd xxx: x-code, x14..x12 encode index instructions e = 0: lim = 20 zeros // lim1, range 0..4,095 e = 1: lim = 4 zeros // lim1 // lim2, range 0..268,435,455 lim1 op-code 0001 00 rd-code rs-code d s 9 e xxx notation: xmx rd, rs , imm xmx rd, rs, 0 (move without flag change) description: the source operand is placed shifted left by 0, 1, 2 or 3 bit positions in the destination register, corresponding to a multiplication by 1, 2, 4 or 8. at xm1..xm4, a trap to range error occurs i f the source operand is higher than the immediate operand lim (upper bound). all condition flags remain unchanged. all operands and the result are interpreted as unsigned integers. the sr must not be denoted as a source or as a destination, nor the pc as a destination operand; these notations are reversed for future expansion. when the pc is denoted as a source operand, a trap to range error occurs if pc > lim. operation: x - code format notation operation 0 rrlim xm1 rd, rs, lim rd := rs * 1; if rs > lim then trap t range error; 1 rrlim xm2 rd, rs, lim rd := rs * 2; if rs > lim then trap t range error; 2 rrlim xm4 rd, rs, lim rd := rs * 4; if rs > lim then trap t range error;
a - 146 appendix a. instruction set details index move (continued) xmx 3 rrlim xm8 rd, rs, lim rd := rs * 8; if rs > lim then trap t range error; 4 rrlim xx1 rd, rs, 0 rd := rs * 1; -- move without flag change 5 rrlim xx2 rd, rs, 0 rd := rs * 2; 6 rrlim xx4 rd, rs, 0 rd := rs * 4; 7 rrlim xx8 rd, rs, 0 rd := rs * 8; exceptions: none.
appendix a. instruction set details a - 147 exclusive or xor format: rr format op-code 0011 11 rs-code d 15 7 4 3 0 s = 0: rs-code encodes g0..g15 for rs s = 1: rs-code encodes l0..l15 for rs d = 0: rd-code encodes g0..g15 for rd d = 1: rd-code encodes l0..l15 for rd s rd-code 8 9 notation: xor rd, rs description: the result of a bitwise exclusive or (xor) of the source operand (rs) and the destination operand (rd) is placed in the destination register (rd) and the z flag is set or clea red accordingly. all operands and the results are interpreted as bit - stings of 32bits each. operation: rd := rd xor rs; z := rd = 0; exceptions: none.
a - 148 appendix a. instruction set details exclusive or immediate xori format: rimm format 15 8 7 4 3 0 imm2 d = 0: rd-code encodes g0..g15 for rd, d = 1: rd-code encodes l0..l15 for rd n: bit 8 // bits 3..0 encode n = 0..31, see table 2.3 encoding of immediate values for encoding of imm imm1 op-code 0111 11 rd-code n d n notation: xori rd, imm description: the result of a bitwise exclusive or (xor) o f the immediate operand (imm) and the destination operand (rd) is placed in the destination register (rd) and the z flag is set or cleared accordingly. all operands and the results are interpreted as bit - stings of 32bits each. operation: rd := rd xor imm; z := rd = 0; exceptions: none .


▲Up To Search▲   

 
Price & Availability of GMS30C2216

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X